wcf binding - WCF - Getting CommunicationException -


i have wcf service providing authentication/authorization different wcf service.

here sample method:

 public int addcustomerstopinfo(customerstop stop)             {                 var request = new addcustomerstopinforequest(stop);                  var service = new channelfactory<iaccountmanagementchannel>("wshttpbinding_iaccountmanagement").createchannel();                  try                 {                     var response = service.addcustomerstopinfo(request);                     service.close();                      return response.addcustomerstopinforesult;                 }                 catch (communicationexception e)                 {                     service.abort();                     throw;                 }              } 

on service.addcustomerstopinfo() method call, exception thrown. message reads:

secure channel cannot opened because security negotiation remote endpoint has failed. may due absent or incorrectly specified endpointidentity in endpointaddress used create channel. please verify endpointidentity specified or implied endpointaddress correctly identifies remote endpoint.

the server binding service looks like:

 <bindings>       <wshttpbinding>         <binding name="wshttpbinding_iaccountmanagement" 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="100065536"           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" />         </binding>  ...   <services>       <service behaviorconfiguration="abcd.service.service1behavior"         name="abcd.service.accountmanagement">         <endpoint address="" behaviorconfiguration="validationbehavior"           binding="wshttpbinding" bindingconfiguration="wshttpbinding_iaccountmanagement"           name="wshttpbinding_iaccountmanagement" contract="abcd.service.iaccountmanagement">           <identity>             <dns value="localhost" />           </identity>         </endpoint>         <endpoint address="mex" behaviorconfiguration="" binding="mexhttpbinding"           contract="imetadataexchange" />       </service> 

and client side:

<client>   <endpoint address="[site location]/accountmanagement.svc"     binding="wshttpbinding"      contract="iaccountmanagement" name="wshttpbinding_iaccountmanagement">   </endpoint> </client> 

both services on same server. don't understand why getting error if other service has <security mode="none"> ?

as trying use secure binding via wshttpbinding need connect server via https , use debug code allow permissive connection test server.

this because you'll have self signed certificate , https strict when comes security certificates.


Comments

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -