通过Java客户端连接到WCF服务 [英] Connect via Java client to WCF Service

查看:361
本文介绍了通过Java客户端连接到WCF服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有有2个端点WCF服务:和的wsHttpBinding basicHttpBinding的。我可以连接到通过C#客户端的每个端点。



我的WCF服务配置



 <服务behaviorConfiguration =App.ServiceBehavior
NAME =则将MyService>
<端点地址=/ WS绑定=的wsHttpBindingbindingConfiguration =httpBindingForWs
合同=Namespace.IMyService>
<同一性GT;
< DNS值=127.0.0.1/>
< /身份>
< /端点>
<端点地址=/基本的绑定=basicHttpBinding的bindingConfiguration =httpBindingForBasic
合同=Namespace.IMyService>
<同一性GT;
< DNS值=127.0.0.1/>
< /身份>
< /端点>
<端点地址=MEX绑定=mexHttpBinding合同=IMetadataExchange接口/>
<主机>
< baseAddresses>
<添加baseAddress =http://127.0.0.1:12000/MyService/>
< / baseAddresses>
< /主机>
< /服务>



我可以在Java生成WSDL。你能告诉我的示例代码,我怎么能消耗basicHttpBinding的在Java中?


解决方案

您可以使用Java消耗Web服务有不同框架,以使您的工作更容易,如 AXIS 并的阿帕奇CXF



请看下面就同一


$ b文章更多的指针$ b

消费与Java

I have WCF service which has 2 endpoints: wsHttpBinding and basicHttpBinding. I can connect to each endpoint via C# client.

My Wcf Service configuration

  <service behaviorConfiguration="App.ServiceBehavior"
          name="MyService">
        <endpoint address="/ws" binding="wsHttpBinding" bindingConfiguration="httpBindingForWs"
           contract="Namespace.IMyService">
          <identity>
            <dns value="127.0.0.1" />
          </identity>
        </endpoint>
        <endpoint address="/basic" binding="basicHttpBinding" bindingConfiguration="httpBindingForBasic"
            contract="Namespace.IMyService">
          <identity>
            <dns value="127.0.0.1" />
          </identity>
        </endpoint>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
        <host>
          <baseAddresses>
            <add baseAddress="http://127.0.0.1:12000/MyService" />
          </baseAddresses>
        </host>
      </service>

I can generate wsdl in Java. Can you show me sample code, how can I consume basicHttpBinding in Java?

解决方案

you can consume the webservice using Java there are different frameworks to make your job easier, like AXIS and Apache CXF

Look at following article for more pointers on same

Consuming WCF services with Java

这篇关于通过Java客户端连接到WCF服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆