“An unsecured or incorrectly secured fault was received from the other party”

匿名 (未验证) 提交于 2019-12-03 08:48:34

问题:

I'm getting:

"An unsecured or incorrectly secured fault was received from the other party. See the inner Fault Exception for the fault code and detail."

I've done this on the client side and I've done the same in a console application, but that error came may be something conflict.

I've checked the app.config as well.

Code is:

<client>   <endpoint address="net.tcp://localhost:5054/player" binding="netTcpBinding" bindingConfiguration="NetTcpBinding_IPlayerService" contract="PlayerService.IPlayerService" name="NetTcpBinding_IPlayerService">     <identity>       <dns value="pident.cloudapp.net"/>     </identity>   </endpoint>   <endpoint address="net.tcp://localhost:5049/public" binding="netTcpBinding" bindingConfiguration="NetTcpBinding_IPublicService" contract="Public Service.IPublicService" name="NetTcpBinding_IPublicService"/>   <endpoint address="net.tcp://localhost:5051/user" binding="netTcpBinding" bindingConfiguration="NetTcpBinding_IUserService" contract="User Service.IUserService" name="NetTcpBinding_IUserService">     <identity>       <dns value="pident.cloudapp.net"/>     </identity>   </endpoint> 

Does anyone have any idea?

回答1:

I just had this issue and had to turn off security context on WCF bindings. You need to turn them off on the bindings in both the client and the service.

Here's the config file if your WCF is IIS-hosted:

<ws2007FederationHttpBinding>     <binding>         <security mode="TransportWithMessageCredential">             <message establishSecurityContext="false" />         </security>     </binding> </ws2007FederationHttpBinding> 

See this post: http://stack247.wordpress.com/2013/05/28/an-unsecured-or-incorrectly-secured-fault-was-received-from-the-other-party/



回答2:

In command prompt, check if the testclient is accepting the parameters correctly or not.

Example:
C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE>wcftestclient.exe http://localhost:31/AuthenicationService.svc?wsdl

If the inputs you have given is not matching, there is problem with the service.
Rather you have to re-look into the service created.
If there is no problem found in it, only then go for the client side.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!