[英]Should I use basicHttpBinding or WsHttpBinding for creating a secure Java Client?
I've spent hours today trying to get a very simple WCF Service and a Java Client to communicate with each other. 今天,我已经花费了数小时试图获得一个非常简单的WCF服务和一个Java Client进行相互通信。 I've only been successful on getting the Service and Client to communicate using a basicHttpBinding with no security enabled.
我仅成功使服务和客户端使用basicHttpBinding进行通信,并且未启用安全性。
I would like to have the contents encrypted over the wire. 我想通过网络加密内容。 I've tried using the basicHttpBinding config of this:
我尝试使用此的basicHttpBinding配置:
<basicHttpBinding>
<binding name="bindingConfig">
<security mode="Transport">
<transport clientCredentialType="Windows" />
</security>
</binding>
</basicHttpBinding>
This now pretty much causes tons of problems because when my service is hosted on IIS I get certificate errors when trying to test the WCF service locally (VS2012 using WCF Test Client), browsing to the WSDL with any browser, and when using Svcutil/wsimport utilities to generate clients. 现在,这几乎引起了很多问题,因为当我的服务托管在IIS上时,当尝试在本地测试WCF服务(使用WCF Test Client的VS2012),使用任何浏览器浏览到WSDL以及使用Svcutil / wsimport时,都会收到证书错误。生成客户端的实用程序。
What I don't understand is when I was using WsHttpBinding and using Transport/Windows security I never had certificate issues, why is that? 我不了解的是,当我使用WsHttpBinding和Transport / Windows安全性时,我从未遇到过证书问题,为什么?
What is the easiest way for me to implement what I am after anyone have thoughts? 在任何人思考之后,实现我自己的最简单方法是什么?
WCF and Java compatibility is a little bit complicated. WCF和Java的兼容性有点复杂。
First of all, which framework do you use in Java ? 首先,您在Java中使用哪个框架?
Secondly, on the WCF side, you should better use a custom binding instead of a wsHttpBinding. 其次,在WCF方面,您最好使用自定义绑定而不是wsHttpBinding。 You can easily convert your binding using this tool .
您可以使用此工具轻松转换绑定。 With your binding it will give :
与您的绑定它将给:
<customBinding>
<binding name="NewBinding0">
<textMessageEncoding MessageVersion="Soap11" />
<httpsTransport authenticationScheme="Negotiate" />
</binding>
</customBinding>
Now you just have to configure the Java side or adapt the WCF configuration, to enable SOAP12, instead of SOAP11. 现在,您只需要配置Java端或修改WCF配置即可启用SOAP12,而不是SOAP11。 Let me know if it works.
让我知道它是否有效。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.