用WCF写得webservice发布后,JAVA不能调用

madyak 2015-02-06 10:17:05
<?xml version="1.0"?>
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="wumanBinding1" maxReceivedMessageSize="2000000" transferMode="Streamed" sendTimeout="08:00:00" receiveTimeout="08:00:00"/>

</basicHttpBinding>
<netTcpBinding>
<binding name="wumanBinding2" transferMode="Streamed" maxReceivedMessageSize="2000000" sendTimeout="08:00:00" receiveTimeout="08:00:00"/>
</netTcpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="GateWayBehaviors">
<!-- 为避免泄漏元数据信息,


请在部署前将以下值设置为 false 并删除上面的元数据终结点 -->
<serviceMetadata httpGetEnabled="true"/>
<!-- 要接收故障异常详细信息以进行调试,


请将以下值设置为 true。在部署前设置为 false
以避免泄漏异常信息-->
<serviceDebug includeExceptionDetailInFaults="true"/>
<serviceThrottling maxConcurrentCalls="200" maxConcurrentInstances="100" maxConcurrentSessions="100"/>
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service name="GateWayService.GateWayService" behaviorConfiguration="GateWayBehaviors">
<endpoint address="" binding="basicHttpBinding" contract="GateWayService.IGateWayService">
<identity>
<dns value="192.168.40.128"/>
</identity>
</endpoint>
<host>
<baseAddresses>
<add baseAddress="http://192.168.40.128:9012/GateWayService"/>
</baseAddresses>
</host>
</service>
</services>
</system.serviceModel>
</configuration>
以上为发布的脚本,请高人看看有没有问题?
在IE里输入http://192.168.40.128:9012/GateWayService?wsdl,能正常显示

<?xml version="1.0" encoding="utf-8" ?>
- <wsdl:definitions name="GateWayService" targetNamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:tns="http://tempuri.org/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata">
- <wsdl:types>
- <xsd:schema targetNamespace="http://tempuri.org/Imports">
<xsd:import schemaLocation="http://192.168.40.128:9012/GateWayService?xsd=xsd0" namespace="http://tempuri.org/" />
<xsd:import schemaLocation="http://192.168.40.128:9012/GateWayService?xsd=xsd1" namespace="http://schemas.microsoft.com/2003/10/Serialization/" />
<xsd:import schemaLocation="http://192.168.40.128:9012/GateWayService?xsd=xsd2" namespace="http://schemas.microsoft.com/2003/10/Serialization/Arrays" />
<xsd:import schemaLocation="http://192.168.40.128:9012/GateWayService?xsd=xsd3" namespace="http://schemas.datacontract.org/2004/07/GateWayService" />
<xsd:import schemaLocation="http://192.168.40.128:9012/GateWayService?xsd=xsd4" namespace="http://schemas.microsoft.com/Message" />
<xsd:import schemaLocation="http://192.168.40.128:9012/GateWayService?xsd=xsd5" namespace="http://schemas.datacontract.org/2004/07/GateWayService.Modal" />
<xsd:import schemaLocation="http://192.168.40.128:9012/GateWayService?xsd=xsd6" namespace="http://schemas.datacontract.org/2004/07/System.Data" />
</xsd:schema>
</wsdl:types>
。。。。。

- <wsdl:input>
<soap:body use="literal" />
</wsdl:input>
- <wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name="GetDBTable">
<soap:operation soapAction="http://tempuri.org/IGateWayService/GetDBTable" style="document" />
- <wsdl:input>
<soap:body use="literal" />
</wsdl:input>
- <wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
- <wsdl:service name="GateWayService">
- <wsdl:port name="BasicHttpBinding_IGateWayService" binding="tns:BasicHttpBinding_IGateWayService">
<soap:address location="http://192.168.40.128:9012/GateWayService" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
谢谢回复
...全文
173 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
madyak 2015-02-06
  • 打赏
  • 举报
回复
说明一下,虽说JAVA不能调用,但C#调用是没有问题的。但不知道问题出在哪里?
TianShangYouHuiJi 2015-02-06
  • 打赏
  • 举报
回复
反悔json,xml吧。。。别返回c#特有的
andyliuxiaobo 2015-02-06
  • 打赏
  • 举报
回复
应该不会出现java调用不了的问题,你说的java不能调用具体是什么情况?
  • 打赏
  • 举报
回复
通过xml肯定能调用,如果是通过类似vs的添加引用方式,有些特定的东西比如DataTable java是支持不了的
by_封爱 版主 2015-02-06
  • 打赏
  • 举报
回复
你这有什么看的.. 不过C#能调用证明你的接口没错啊. 是不是java语言太弱了 根本调用不了webservice呢?
本拉灯 2015-02-06
  • 打赏
  • 举报
回复
如果返回的是C#的实体或DataTable这类的东西,基本是无法还原出实体的。 你只能去解析他里面的XML数据,如果只是平常的类型,那也要解析XML数据。
madyak 2015-02-06
  • 打赏
  • 举报
回复
顶一下,居然没人理会

110,473

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧