关于webservice

qwer_boo 2016-05-22 11:26:49
情况是这样的,现在有客户端用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吗?
不知道有没有对这个了解的?求指导。
...全文
147 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
sgyiliya 2016-05-23
  • 打赏
  • 举报
回复
尝试一下:

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

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

qwer_boo 2016-05-23
  • 打赏
  • 举报
回复
引用 1 楼 rocmemory 的回复:
CallInterface只是调用接口的方法,真正的接口名称在参数中
貌似服务端如果是C#写的,则声称客户端的时候需要一个.asmx的文件。。。 我查了一下,最终调用的是

HisDal.HisReferance.CallInterfaceResponse retVal = ((HisDal.HisReferance.WSInterfacePortType)(this)).CallInterface(inValue);
还是CallInterface这个接口,参数是invalue。
为轮子而生 2016-05-23
  • 打赏
  • 举报
回复
CallInterface只是调用接口的方法,真正的接口名称在参数中
为轮子而生 2016-05-23
  • 打赏
  • 举报
回复
msgHeader写你要调用的函数名,babyInfoStr写参数,试一下

110,534

社区成员

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

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

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