关于webservice

.Net技术 码拜 9年前 (2016-03-09) 1201次浏览
情况是这样的,现在有客户端用C#写的,然后调用webservice,服务端不知道是java还是C#或其他语言写的。
C#这边调用webservice的代码是:

var xmlStr = new WSInterfacePortTypeClient().CallInterface(msgHeader, babyInfoStr);

返回xml串。
然后C#这边的配置文件是这样的,在app.config中的配置是这样的:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="WSInterfaceSoap11Binding" closeTimeout="00:00:10"
         openTimeout="00:00:10" receiveTimeout="00:00:10" sendTimeout="00:00:10"
         maxBufferPoolSize="655360000000" maxBufferSize="655360000" maxReceivedMessageSize="655360000000"
         transferMode="Streamed">
          <readerQuotas maxDepth="64" maxStringContentLength="655360000"
            maxArrayLength="655360000" maxBytesPerRead="655360000" maxNameTableCharCount="655360000" />
          <security mode="None" />
        </binding>
      </basicHttpBinding>
    </bindings>
    <client>
      <endpoint address="http://168.2.5.28:1506/services/WSInterface.WSInterfaceHttpSoap11Endpoint"
          binding="basicHttpBinding" bindingConfiguration="WSInterfaceSoap11Binding"
          contract="HisReferance.WSInterfacePortType" name="WSInterfaceHttpSoap11Endpoint" />
    </client>
  </system.serviceModel>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
  </startup>

现在想用java来重写,但是网上查了下,一般都需要知道一个地址,例如http://x.x.x.x/service/abc.asmx,现在的疑问是
endpoint address=”http://168.2.5.28:1506/services/WSInterface.WSInterfaceHttpSoap11Endpoint 的后缀并不是.asmx,
而且这句:
var xmlStr = new WSInterfacePortTypeClient().CallInterface(msgHeader, babyInfoStr);能说明服务端的方法名就是
CallInterfacea吗?
不知道有没有对这个了解的?求指导。

解决方案

80

CallInterface只是调用接口的方法,真正的接口名称在参数中

20

尝试一下:

http://168.2.5.28:1506/services/WSInterface.WSInterface.asmx
或:
http://168.2.5.28:1506/services/WSInterface.asmx

CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明关于webservice
喜欢 (0)
[1034331897@qq.com]
分享 (0)