Well, until now, I have only one endpoint and the endpoint for the metadata. Then, I use internet explorer for example, and I can see the metadata.
However, when I configure a second endpoint for other contract, I can't get the metadata, so the service does not expose the contract correctly and I can't use the srvice from the client.
My app.config (it is a self host service) is:
<system.serviceModel>
<services>
<service name="GTS.CMMS.Service.Service" behaviorConfiguration="behaviorConfig">
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:7997/CMMSHost"/>
<add baseAddress="http://localhost:7998/CMMSHost"/>
</baseAddresses>
</host>
<endpoint address="ServiceCore/"
binding="netTcpBinding"
bindingConfiguration="ServiceCore"
name="ServiceCore"
contract="GTS.CMMS.Service.IService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="ServiceDocumentos/"
binding="ServiceDocumentos"
bindingConfiguration="basicHttpBinding"
name="ServiceDocumentos"
contract="GTS.CMMS.Service.IServiceDocumentos">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint contract="IMetadataExchange" binding="mexHttpBinding" address="http://localhost:5000/mex" listenUriMode="Explicit" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="behaviorConfig">
<serviceDebug includeExceptionDetailInFaults="true"/>
<serviceThrottling maxConcurrentCalls="100" maxConcurrentSessions="100" />
<serviceMetadata/>
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<netTcpBinding>
<binding name="ServiceCore" maxBufferSize="67108864"
maxReceivedMessageSize="67108864" maxBufferPoolSize="67108864"
transferMode="Buffered" closeTimeout="00:00:10"
openTimeout="00:00:10" receiveTimeout="00:20:00"
sendTimeout="00:01:00" maxConnections="100"
portSharingEnabled="true">
<security mode="None"/>
<readerQuotas maxArrayLength="67108864" maxBytesPerRead="67108864" maxStringContentLength="67108864"/>
<reliableSession enabled="true" inactivityTimeout="00:20:00" />
</binding>
<binding name="ServiceDocumentos" maxBufferSize="67108864"
maxReceivedMessageSize="67108864" maxBufferPoolSize="67108864"
transferMode="Streamed" closeTimeout="00:00:10"
openTimeout="00:00:10" receiveTimeout="00:20:00"
sendTimeout="00:01:00" maxConnections="100"
portSharingEnabled="true">
<security mode="None"/>
<readerQuotas maxArrayLength="67108864" maxBytesPerRead="67108864" maxStringContentLength="67108864"/>
<reliableSession enabled="true" inactivityTimeout="00:20:00" />
</binding>
</netTcpBinding>
<basicHttpBinding>
<binding name="ServiceDocumentos" messageEncoding="Mtom" transferMode="Streamed" />
<binding name="ServiceCore" messageEncoding="Mtom" transferMode="Buffered" />
</basicHttpBinding>
</bindings>
</system.serviceModel>
Thanks.
Related
Below is the web.config file I used.
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5"/>
</system.web>
<system.serviceModel>
<services>
<!--Note: the service name must match the configuration name for the service implementation.-->
<service name="_1C_GBCService.GBCService" behaviorConfiguration="GBCServiceBehavior">
<endpoint address=""
binding="wsHttpBinding"
contract="_1C_GBCService.IGBCService" />
<!--Add the following endpoint.
Note: your service must have an http base address to add this endpoint.-->
<endpoint contract="IMetadataExchange" binding="mexHttpBinding" address="mex" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="GBCServiceBehavior">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
<!--policyVersion="Policy15"-->
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
<!--<behavior name="ServiceBehavior">
<serviceMetadata httpGetEnabled="true" />
</behavior>-->
</serviceBehaviors>
</behaviors>
<protocolMapping>
<add binding="basicHttpsBinding" scheme="https" />
</protocolMapping>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
<bindings>
<basicHttpBinding>
<binding name="VASASMXSoap" />
</basicHttpBinding>
<netTcpBinding>
<binding name="NetTcpBinding_ILogging">
<security mode="None" />
</binding>
</netTcpBinding>
<wsHttpBinding>
<binding name="WSHttpBinding_ILogging" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384"/>
<reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false"/>
<security mode="None">
<transport clientCredentialType="Windows" proxyCredentialType="None" realm=""/>
<message clientCredentialType="Windows" negotiateServiceCredential="true"/>
</security>
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address="http://onecuatcoresrvs.cognizant.com/messaging/onecommunicator/notification/vas.asmx"
binding="basicHttpBinding" bindingConfiguration="VASASMXSoap"
contract="OneCommunicatorService.VASASMXSoap" name="VASASMXSoap">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="http://onecsitcoresrvs.cognizant.com/255/Logging.svc"
binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_ILogging"
contract="ExceptionLoggingService.ILogging" name="WSHttpBinding_ILogging">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="net.tcp://onecsitcoresrvs.cognizant.com/255/Logging.svc"
binding="netTcpBinding" bindingConfiguration="NetTcpBinding_ILogging"
contract="ExceptionLoggingService.ILogging" name="NetTcpBinding_ILogging">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
</client>
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
<!--
To browse web app root directory during debugging, set the value below to true.
Set to false before deployment to avoid disclosing web app folder information.
-->
<directoryBrowse enabled="true"/>
</system.webServer>
And am confused whether to add the attributes other than name in binding element.
To enable publishing of your metadata for your service GBCService. I added bindingConfiguration equals to WSHttpBinding_ILogging.
<service name="_1C_GBCService.GBCService" behaviorConfiguration="GBCServiceBehavior">
<endpoint address="" bindingConfiguration="WSHttpBinding_ILogging"
binding="wsHttpBinding"
contract="_1C_GBCService.IGBCService" />
<!--Add the following endpoint.Note: your service must have
an http base address to add this endpoint.-->
<endpoint contract="IMetadataExchange" binding="mexHttpBinding" address="mex" />
</service>
And changed your protocol mapping to wsHttpBinding and scheme to HTTP because that was the binding you are using. And HTTP because your metadata exchange or mex used non-secured mexHttpBinding.
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="false" />
<protocolMapping>
<add binding="wsHttpBinding" scheme="http" />
</protocolMapping>
At the client side when consuming the service am getting the following exception:
The message with To 'net.tcp://puv15xgts:55201/Ois//Patient/PatientHistory/PatientHistoryService.svc' cannot be processed at the receiver, due to an AddressFilter mismatch at the EndpointDispatcher. Check that the sender and receiver's EndpointAddresses agree.
Here is the web.config:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
<add key="ospUri" value="http://PUV15XGTS:55000/OSPServices/ServerSettings.svc"/>
<add key="IAuthorization" value="http://PUV15XGTS:55000/OSPServices/Authorization.svc"/>
<add key="ospSystem" value="OSP8"/>
</appSettings>
<connectionStrings/>
<system.serviceModel>
<extensions>
<behaviorExtensions>
<add name="secureOptions" type="VMS.SDF.CustomBehaviorExtensionElement, VMS.SDF"/>
<add name="faultTransport" type="VMS.SDF.FaultTransfer.FaultTransferExtensionElement, VMS.SDF"/>
</behaviorExtensions>
</extensions>
<bindings>
<basicHttpBinding>
<binding>
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="1073741824" maxBytesPerRead="4096" maxNameTableCharCount="16384"/>
</binding>
</basicHttpBinding>
<netTcpBinding>
<binding closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" portSharingEnabled="true" sendTimeout="00:01:00" transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="67108864" maxBufferSize="67108864" maxReceivedMessageSize="67108864">
<readerQuotas maxDepth="256" maxStringContentLength="67108864" maxArrayLength="67108864" maxBytesPerRead="67108864" maxNameTableCharCount="67108864"/>
<security mode="None">
</security>
</binding>
</netTcpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="ServiceBehavior">
<serviceMetadata httpGetEnabled="false"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
<dataContractSerializer maxItemsInObjectGraph="65536000"/>
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="SecuredService">
<secureOptions validateRequest="true" securityLevel="Core" tokenTimeToLive="60"/>
<faultTransport/>
</behavior>
</endpointBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="ServiceBehavior" name="VMS.WebServices.Ois.Patient.PatientHistoryService.ServiceImplementation.PatientHistoryService">
<host>
<baseAddresses>
<!-- <add baseAddress="http://localhost/" />-->
<add baseAddress="net.tcp://localhost:55201/"/>
</baseAddresses>
</host>
<endpoint address="" binding="basicHttpBinding" contract="VMS.WebServices.Ois.Patient.PatientHistoryService.ServiceContracts.IPatientHistoryService" behaviorConfiguration="SecuredService">
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<!--<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />-->
<endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange"/>
<endpoint address="" binding="netTcpBinding" bindingConfiguration="" name="NetTcpBindingEndpoint" contract="VMS.WebServices.Ois.Patient.PatientHistoryService.ServiceContracts.IPatientHistoryService" behaviorConfiguration="SecuredService">
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
</service>
</services>
</system.serviceModel>
<system.web>
<compilation debug="true"/>
</system.web>
</configuration>
Please help whats going wrong here.
We have a WCF service in net.tcp binding. This one is hosted in IIS 7 with WAS. The bindings of the web site are :
http mydns.mysocity.com 80
nt.tcp 8001 (nothing to specify dns)
The configuration of the service is something like this :
<system.serviceModel>
<client />
<bindings>
<netTcpBinding>
<binding name="netTCP" maxReceivedMessageSize="2147483647" receiveTimeout="06:00:00" >
<security mode="Transport" >
<transport clientCredentialType="Windows" />
<message clientCredentialType="Windows" />
</security>
<reliableSession enabled="true" inactivityTimeout="06:00:00" ordered="true" />
<readerQuotas maxDepth="2000001" maxStringContentLength="2000001"
maxArrayLength="2000001" maxBytesPerRead="2000001" maxNameTableCharCount="2000001" />
</binding>
</netTcpBinding>
<wsDualHttpBinding>
<binding name="dualHttp" closeTimeout="00:01:00" openTimeout="00:01:00"
receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false"
transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text"
textEncoding="utf-8" useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="06:00:00" />
<security mode="Message">
<message clientCredentialType="Windows" negotiateServiceCredential="true"
algorithmSuite="Default" />
</security>
</binding>
</wsDualHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="serviceBehavior">
<serviceDebug includeExceptionDetailInFaults="true"/>
<serviceMetadata httpGetEnabled="true"/>
<serviceThrottling maxConcurrentCalls="2000" maxConcurrentInstances="2000" maxConcurrentSessions="2000"/>
<dataContractSerializer maxItemsInObjectGraph="96553600" ignoreExtensionDataObject="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service name="MyService.Services.PublishSubscribeService" behaviorConfiguration="serviceBehavior">
<!--Service de souscription/publication pour les clients qui veulent publier/souscrire et etre notify sur le meme canal. TCP,dualHttp et PoolingDuplex ONLY-->
<endpoint binding="netTcpBinding" bindingConfiguration="netTCP" address="/ITransientPublishSubscribeService/netPublicEndPoint" name="netPublicEndPoint" contract="MyService.Services.Interfaces.ITransientPublishSubscribeService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<!--service de publication-->
<endpoint binding="wsDualHttpBinding" bindingConfiguration="dualHttp" address="/IPublishService/wsDualPublicEndPoint" name="wsDualPublicEndPoint" contract="MyService.Services.Interfaces.IPublishService"/>
<endpoint address="mex" binding="mexHttpBinding" bindingConfiguration="" name="mexEndPoint" contract="IMetadataExchange" />
</service>
<endpoint binding="netTcpBinding" bindingConfiguration="netTCP" address="/ITransientGuarantedPublishSubscribeService/netPublicEndPoint" name="netPublicEndPoint" contract="MyService.Services.Interfaces.ITransientGuarantedPublishSubscribeService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint binding="netTcpBinding" bindingConfiguration="netTCP" address="/ITransientGuarantedSubscribeService/netPublicEndPoint" name="netPublicEndPoint" contract="MyService.Services.Interfaces.ITransientGuarantedSubscribeService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint binding="netTcpBinding" bindingConfiguration="netTCPNotReliable" address="/ITransientGuarantedPublishSubscribeService/netPublicEndPointNotReliable" name="netPublicEndPointNotReliable" contract="MyService.Services.Interfaces.ITransientGuarantedPublishSubscribeService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint binding="netTcpBinding" bindingConfiguration="netTCPNotReliable" address="/ITransientGuarantedSubscribeService/netPublicEndPointNotReliable" name="netPublicEndPointNotReliable" contract="MyService.Services.Interfaces.ITransientGuarantedSubscribeService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" bindingConfiguration="" name="mexEndPoint" contract="IMetadataExchange" />
</service>
</services>
</system.serviceModel>
And the WSDL contains MachineName.MySocity.com for base address instead of mydns.mysocity.com :
<wsdl:port name="netPublicEndPoint" binding="tns:netPublicEndPoint">
<soap12:address location="net.tcp://MachineName.MySocity.com:8001/Services/PublishSubscribeService.svc/ITransientPublishSubscribeService/netPublicEndPoint"/>
<wsa10:EndpointReference>
<wsa10:Address>
net.tcp://MachineName.MySocity.com:8001/Services/PublishSubscribeService.svc/ITransientPublishSubscribeService/netPublicEndPoint
</wsa10:Address>
<Identity xmlns="http://schemas.xmlsoap.org/ws/2006/02/addressingidentity">
<Dns>localhost</Dns>
</Identity>
</wsa10:EndpointReference>
</wsdl:port>
The application is working but the client is caching the MetaData so we must close the application when we change the hosting server.
How can I change the base address in the WSDL to have mydns.mysocity.com ?
I have tested to add base address to my configuration but it doesn't work :
<host>
<baseAddresses>
<add baseAddress="net.tcp://mydns.mysocity.com:8001/Services/PublishSubscribeService.svc"/>
<add baseAddress="http://mydns.mysocity.com/Services/PublishSubscribeService.svc"/>
</baseAddresses>
</host>
We have a wcf webservice that an external client will be using to provide requests. This webservice (the webservice) calls another wcf service ( the agent) where the business logic is implemented.
The agent also monitors activity in the database and when the requested information is ready (often days later) the agent generates an object containing the requested data. It needs to pass the object to the webservice where the webservice will form XML and post it to the clients webservice.
The webservice implements two different imterfaces, one that the client uses and one that the agent uses.
The trouble is, on the local machine, I am unable to get the agent to connect to the webservice to send the results. Both the webservice and the agent are running on my local machine for debugging purposes. In VisualStudio2012, the webservice project is set up to use IISExpress and defines a specific port to use. Project URL: https://local.someaddress.net:51448/ However, the port the agent uses to try to connect to the webservice is a different port.
The webservice is able to call the agent just fine, but the agent gets a tcp error code 10061 when it tries to call the webservice.
I've already tried "appcmd.exe set app "Default Web Site/" /enabledProtocols:http,net.tcp".
Is it possible to configure IISExpress to have the webservice open both ports? Or is there something obvious I am missing here?
(Since the config files contain links to localhost and stackoverflow doesn't allow that, I have replaced localhost with local.someaddress.net.)
Here are the contents of the webservice's web.config:
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" maxRequestLength="52428800"/>
</system.web>
<system.serviceModel>
<client>
<endpoint address="net.tcp://local.someaddress.net:8102/Acord/201307" behaviorConfiguration="NetTcpCertificatesBehavior" binding="netTcpBinding" bindingConfiguration="NetTcpCertificatesBinding" contract="AcordContract.IAcordService201307" name="AcordEndpoint">
<identity>
<certificateReference findValue="7da522dd75f3fca2687837b7b67e117a8700ec62" isChainIncluded="false" storeLocation="LocalMachine" x509FindType="FindByThumbprint" />
</identity>
</endpoint>
</client>
<services>
<service name="AcordWebService.AcordWebService" behaviorConfiguration="Visible">
<endpoint address="" binding="basicHttpsBinding" contract="AcordWebService.IAcordWebService" bindingConfiguration="BasicHttpsBinding">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
<!--binding for clients outside the firewall calling from C# with WCF using certs -->
<endpoint address="net.tcp://local.someaddress.net:8122/AcordWebService/201309" binding="netTcpBinding" bindingConfiguration="NetTcpCertificatesBinding" name="NetTcpCertificatesEndpoint" contract="AcordWSContract.IAcordWSService201309">
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
</service>
</services>
<behaviors>
<endpointBehaviors>
<behavior name="NetTcpCertificatesBehavior">
<clientCredentials>
<clientCertificate findValue="631f5a67a9a70bc78540bb809e73fd1dbd00bbeb" storeLocation="LocalMachine" storeName="My" x509FindType="FindByThumbprint" />
<serviceCertificate>
<authentication certificateValidationMode="None" />
</serviceCertificate>
</clientCredentials>
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="Visible">
<!-- To avoid disclosing metadata information, set the values below to false before deployment -->
<serviceMetadata httpGetEnabled="false" httpsGetEnabled="true"/>
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="true"/>
<serviceCredentials>
<serviceCertificate findValue="7da522dd75f3fca2687837b7b67e117a8700ec62" storeLocation="LocalMachine" storeName="My" x509FindType="FindByThumbprint"/>
<clientCertificate>
<certificate findValue="631f5a67a9a70bc78540bb809e73fd1dbd00bbeb" storeLocation="LocalMachine" storeName="My" x509FindType="FindByThumbprint"/>
</clientCertificate>
</serviceCredentials>
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<basicHttpsBinding>
<binding name="BasicHttpsBinding" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
<security mode="Transport">
<transport clientCredentialType="None" />
</security>
</binding>
</basicHttpsBinding>
<wsHttpBinding>
<binding name="WSHttpBinding_IAcordWebService" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" useDefaultWebProxy="true" allowCookies="false">
<readerQuotas maxDepth="32" maxStringContentLength="65535" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="Transport">
<transport clientCredentialType="None" />
</security>
</binding>
<binding name="WSHttpBinding_Mex" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" useDefaultWebProxy="true" allowCookies="false">
<readerQuotas maxDepth="32" maxStringContentLength="65535" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="Transport">
<transport clientCredentialType="None" />
</security>
</binding>
</wsHttpBinding>
<netTcpBinding>
<binding name="NetTcpCertificatesBinding" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
<security>
<transport clientCredentialType="Certificate" protectionLevel="EncryptAndSign" />
</security>
</binding>
</netTcpBinding>
</bindings>
<protocolMapping>
<add binding="wsHttpBinding" scheme="https" />
</protocolMapping>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
<directoryBrowse enabled="true"/>
</system.webServer>
</configuration>
And here are the contents of the agent's app.config file:
<?xml version="1.0"?>
<configuration>
<configSections>
</configSections>
<system.serviceModel>
<client>
<endpoint address="net.tcp://local.someaddress.net:8122/AcordWebService/201309" behaviorConfiguration="NetTcpCertificatesBehavior" binding="netTcpBinding" bindingConfiguration="NetTcpCertificatesBinding" contract="AcordWSContract.IAcordWSService201309" name="AcordWSEndpoint">
<identity>
<certificateReference findValue="7da522dd75f3fca2687837b7b67e117a8700ec62" isChainIncluded="false" storeLocation="LocalMachine" x509FindType="FindByThumbprint" />
</identity>
</endpoint>
<endpoint address="net.tcp://qaschedapp:8001/IMS/201210" binding="netTcpBinding" bindingConfiguration="NetTcpWindowsBinding" contract="IdentityManagementContract.IIdentityManagementService201210" name="IMSEndpoint">
<!--the name above cannot be changed-->
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<endpoint address="net.tcp://qaschedapp:8012/CBS/201210" behaviorConfiguration="NetTcpCertificatesBehavior" binding="netTcpBinding" bindingConfiguration="NetTcpCertificatesBinding" contract="CrossbowContract.ICrossbowService201210" name="CBSEndpoint">
<identity>
<certificateReference findValue="7da522dd75f3fca2687837b7b67e117a8700ec62" isChainIncluded="false" storeLocation="LocalMachine" x509FindType="FindByThumbprint"/>
</identity>
</endpoint>
</client>
<diagnostics performanceCounters="Default"/>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpWindowsBinding">
<security mode="Transport">
<transport clientCredentialType="Windows"/>
</security>
</binding>
</basicHttpBinding>
<netTcpBinding>
<binding>
<readerQuotas maxDepth="32" maxStringContentLength="65535" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384"/>
</binding>
<binding name="NetTcpWindowsBinding" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:01:00" sendTimeout="00:10:00" transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions" hostNameComparisonMode="StrongWildcard" listenBacklog="10" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxConnections="10" maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="32" maxStringContentLength="65535" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384"/>
<reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false"/>
<security mode="Transport">
<transport clientCredentialType="Windows" protectionLevel="EncryptAndSign"/>
<message clientCredentialType="Windows"/>
</security>
</binding>
<binding name="NetTcpCertificatesBinding" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
<security>
<transport clientCredentialType="Certificate" protectionLevel="EncryptAndSign"/>
</security>
</binding>
</netTcpBinding>
</bindings>
<services>
<service name="AcordAgent.AcordService" behaviorConfiguration="AcordServiceBehavior">
<endpoint address="http://qaschedapp:8100/Acord" binding="webHttpBinding" behaviorConfiguration="HttpWebGetBehavior" contract="AcordContract.IMeta" name="MetaEndpoint">
<!--the name of this endpoint above (MetaEndpoint) must stay-->
</endpoint>
<!--binding for clients within the firewall calling from C# with WCF -->
<endpoint address="net.tcp://qaschedapp:8101/Acord/201307" binding="netTcpBinding" bindingConfiguration="NetTcpWindowsBinding" name="NetTcpWindowsEndpoint" contract="AcordContract.IAcordService201307">
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<!--binding for clients outside the firewall calling from C# with WCF using certs -->
<endpoint address="net.tcp://qaschedapp:8102/Acord/201307" binding="netTcpBinding" bindingConfiguration="NetTcpCertificatesBinding" name="NetTcpCertificatesEndpoint" contract="AcordContract.IAcordService201307">
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
</service>
</services>
<behaviors>
<endpointBehaviors>
<behavior name="HttpWebGetBehavior">
<webHttp/>
</behavior>
<behavior name="NetTcpCertificatesBehavior">
<clientCredentials>
<clientCertificate findValue="631f5a67a9a70bc78540bb809e73fd1dbd00bbeb" storeLocation="LocalMachine" storeName="My" x509FindType="FindByThumbprint"/>
<serviceCertificate>
<authentication certificateValidationMode="None"/>
</serviceCertificate>
</clientCredentials>
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="AcordServiceBehavior">
<serviceDebug includeExceptionDetailInFaults="true"/>
<serviceCredentials>
<serviceCertificate findValue="7da522dd75f3fca2687837b7b67e117a8700ec62" storeLocation="LocalMachine" storeName="My" x509FindType="FindByThumbprint"/>
<clientCertificate>
<certificate findValue="631f5a67a9a70bc78540bb809e73fd1dbd00bbeb" storeLocation="LocalMachine" storeName="My" x509FindType="FindByThumbprint"/>
</clientCertificate>
</serviceCredentials>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
</startup>
</configuration>
I found this in an IIS Express FAQ:
Q: Does IIS Express support non-HTTP protocols such as net.tcp or MSMQ?
A: No. IIS Express only supports HTTP and HTTPS as its protocol.
It seems like this is the root of my problem. I need to install IIS on my local machine.
I am getting this exception when trying to access a wcf web service.
[WebException: The remote server returned an error: (400) Bad Request.]
System.Net.HttpWebRequest.GetResponse() +5314029
System.ServiceModel.Channels.HttpChannelRequest.WaitForReply(TimeSpan timeout) +54
Server Binding Information
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="wcfSmartConnect" closeTimeout="10:01:00"
maxBufferSize="104857600" maxBufferPoolSize="104857600"
maxReceivedMessageSize="104857600" openTimeout="10:01:00"
receiveTimeout="10:10:00" sendTimeout="10:01:00"
messageEncoding="Mtom" transferMode="StreamedRequest">
<readerQuotas maxDepth="104857600" maxStringContentLength="104857600"
maxArrayLength="104857600" maxBytesPerRead="104857600"
maxNameTableCharCount="104857600" />
</binding>
</basicHttpBinding>
</bindings>
<services>
<service name="WcfSmartConnect.Service1"
behaviorConfiguration="WcfSmartConnect.Service1Behavior">
<endpoint
address=""
binding="basicHttpBinding"
bindingConfiguration="wcfSmartConnect"
contract="WcfSmartConnect.IService1">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint
address="mex"
binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="WcfSmartConnect.Service1Behavior">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
Client Binding Information
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="wcfSmartConnect" closeTimeout="10:01:00"
maxBufferSize="104857600" maxBufferPoolSize="104857600"
maxReceivedMessageSize="104857600" openTimeout="10:01:00"
receiveTimeout="10:10:00" sendTimeout="10:01:00"
messageEncoding="Mtom" transferMode="StreamedRequest">
<readerQuotas maxDepth="104857600" maxStringContentLength="104857600"
maxArrayLength="104857600" maxBytesPerRead="104857600"
maxNameTableCharCount="104857600" />
</binding>
</basicHttpBinding>
<wsHttpBinding>
<binding name="WSHttpBinding_IService11" closeTimeout="01:00:00"
openTimeout="01:00:00" receiveTimeout="01:00:00"
sendTimeout="01:00:00" bypassProxyOnLocal="false"
transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="1048576000" maxReceivedMessageSize="1048576000"
messageEncoding="Text" textEncoding="utf-8"
useDefaultWebProxy="true" allowCookies="false">
<readerQuotas maxDepth="104857600" maxStringContentLength="104857600"
maxArrayLength="104857600" maxBytesPerRead="1048576000"
maxNameTableCharCount="104857600" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />
<security mode="TransportWithMessageCredential">
<transport clientCredentialType="Windows"
proxyCredentialType="None" realm="" />
<message clientCredentialType="Windows"
negotiateServiceCredential="true" algorithmSuite="Default"
establishSecurityContext="true" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint name="WSHttpBinding_IService11"
address="http://abc.com/API/serv.svc"
binding="wsHttpBinding"
bindingConfiguration="WSHttpBinding_IService11"
contract="SmartConnectRepublic.IService1" >
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint name="BasicHttpBinding_IService1"
address="http://localhost:4649/Service1.svc"
binding="basicHttpBinding"
bindingConfiguration="wcfSmartConnect"
contract="SmartConnect.IService1" />
</client>
</system.serviceModel>
Can you tell us a bit about your setup?
what binding do you use?
is this the only service method? If not: do the others work?
show us the configs on client and server! (everything inside <system.serviceModel> is of interest)
It would appear as if the client times out waiting for the server - this can be because the server takes too long to respond (if you do a lot of data loading); in that case, you need to increase your timeouts on the server and the client
Or you might be sending too large a data packet over the wire - in that case, you might also need to increase the settings for maxReceivedMessageSize et al.
#Pinu: are you trying to upload 5 MB? You have transferMode=StreamRequest, which means your request from the client to the server will be streamed.
If you're transferring 5 MB, it's a good idea to stream - which way do you transfer those bytes??