简体   繁体   English

是否应该使用basicHttpBinding或WsHttpBinding创建安全的Java客户端?

[英]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.

相关问题 BasicHttpBinding和WsHttpBinding之间的代理 - Proxy between BasicHttpBinding and WsHttpBinding 通过WsHttpBinding以编程方式创建Wcf客户端 - Programatically Creating Wcf client with WsHttpBinding 获取与basicHttpBinding相关的错误消息,即使我正在使用wsHttpBinding - getting error message related to basicHttpBinding even though I'm using wsHttpBinding 使用WSHttpBinding,默认情况下安全吗? - using WSHttpBinding, by default is that secure? 如何强制.net WCF客户端在basicHttpBinding中使用NTLM? - How to force a .net WCF client to use NTLM in an basicHttpBinding? 指定用于WSHttpBinding客户端连接的SSL协议版本 - Specify SSL Protocol version to use for WSHttpBinding client connection 为什么客户端配置在服务器上有customBinding时会显示wsHttpBinding? - Why client config shows wsHttpBinding when I have customBinding on server? 客户端的basicHttpBinding ReceiveTimeout - basicHttpBinding ReceiveTimeout of client WCF客户端使用JAVA Web服务 - 我应该使用WCF还是只创建自定义解析器/消息工厂? - WCF client consumes JAVA web service - should I use WCF or just create a custom parser/message factory? 您应该使用什么框架来确保安全的客户端服务器基础架构 - What frameworks should you use to ensure secure client server infrastructure architecture
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM