Because the project needs to deploy the external network of WCF, the program is completed in the company and the test is normal. wsdualhttpbinding Duplex Communication
Client Configuration:
<system.serviceModel> <bindings> <wsDualHttpBinding> <binding name="hhh_IBLLServiceContract" closeTimeout="00:01:00" openTimeout="00:51:00" receiveTimeout="00:50:00" sendTimeout="00:51:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Mtom" textEncoding="utf-8" useDefaultWebProxy="true"> <readerQuotas maxDepth="64" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /> <reliableSession ordered="true" inactivityTimeout="00:50:00" /> <security mode="None"> <message clientCredentialType="Windows" negotiateServiceCredential="true" /> </security> </binding> </wsDualHttpBinding> </bindings> <client> <endpoint address="http://192.168.9.29:8081/Service1.svc" binding="wsDualHttpBinding" bindingConfiguration="hhh_IBLLServiceContract" contract="IBLLServiceContract" name="hhh_IBLLServiceContract"> </endpoint> </client> </system.serviceModel>
Server Configuration:
<system.serviceModel> <bindings> <wsDualHttpBinding> <binding name="hhh" messageEncoding="Mtom"> <security mode="None"/> </binding> </wsDualHttpBinding> </bindings> <services> <service behaviorConfiguration="serviceBehavior" name="RNOP.WCF.Service.BLLService"> <endpoint address="Service1.svc" binding="wsDualHttpBinding" bindingName="hhh" bindingConfiguration="hhh" contract="RNOP.WCF.ServiceInterface.IBLLServiceInterface" > </endpoint> <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" > </endpoint>
No problem in the Intranet test. If it is deployed on the Internet, an exception of operation may have been a portion of a longer timeout is reported.
Check whether the firewall of the server and client is disabled. If the firewall is disabled, the connection still fails;
Check whether the port is in use. If the port is changed, the error persists;
The meta data address on the web page of the service is found to use the computer name, and the computer name is not accessible on the Internet, so the search, found an article on the Internet: http://www.cnblogs.com/lensso/archive/2011/08/01/2124095.html
The remote client cannot be parsed because the metadata address host name is the server computer name.WCFSolution to service metadata
The installation method solves the metadata address parsing problem.
However, the client still cannot connect to the server.
Http://www.cnblogs.com/bryant/archive/2011/09/22/2185621.html
Http://social.msdn.microsoft.com/Forums/en-US/wcfzhchs/thread/0d663107-b47e-464b-82dc-6f191c484870
So in the case of the Internet, the program can work normally, you must ensure that: 1. the client does not have versions earlier than IIS6 installed, that is, port 80 must be empty. Port 2 is occupied in violation of Port 1, so that your clientbaseaddress can be recognized by the server.
The address is set, and the client is connected to the server normally. The problem is solved.