WEB service 接口遇到问题,求帮忙!!!

xiaoyaolanchong 2012-03-19 02:52:45

###########################################################
用soapUI对接对方的接口,wireshark针对网卡抓包,得到的发送数据为:
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:com="http://XXX name space/test">
<soapenv:Header/>
<soapenv:Body>
<com:changePassword>
<userAccount>
Name1234 </userAccount>
<newPassword>
222222
</newPassword>
<oldPassword>
222222
</oldPassword>
<operatorInfo>
<!--Optional:-->
<account>
lsczy1
</account>
<id>
?
</id>
<!--Optional:-->
<source>
?
</source>
</operatorInfo>
<resInfoHolder>
<infoNo>
?
</infoNo>
<!--Optional:-->
<infoStr>
?
</infoStr>
</resInfoHolder>
</com:changePassword>
</soapenv:Body>
</soapenv:Envelope>

##################################################################
我用Delphi7 和对方对接,抓包,监测到的发送结果是:
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body>
<changePassword
xmlns="http://XXX name space/test">
<userAccount>
Name1234 </userAccount>
<newPassword>
222222
</newPassword>
<oldPassword>
222222
</oldPassword>
<operatorInfo>
<account>
lsczy1
</account>
<id>
0
</id>
<source>
</source>
</operatorInfo>
<resInfoHolder>
<infoNo>
0
</infoNo>
<infoStr>
</infoStr>
</resInfoHolder>
</changePassword>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

############################################################
对比之后,发现在Body开始的时候,命名空间声明有差别
<SOAP-ENV:Body>
<changePassword
xmlns="http://XXX name space/test">

#############################################################
最后Dephi提示这样的错误!!!!!
“ Cannot find child element: userAccount”


#############################################################
我的接口初始化如下:
InvRegistry.RegisterInterface(TypeInfo(UserAcct), 'http://XXX name space/test, '');
InvRegistry.RegisterDefaultSOAPAction(TypeInfo(UserAcct), '');
InvRegistry.RegisterInvokeOptions(TypeInfo(UserAcct), ioDocument);
RemClassRegistry.RegisterXSInfo(TypeInfo(stringArray), 'http://jaxb.dev.java.net/array', 'stringArray');


望高手不吝赐教,非常感谢!
兄弟分不多了,有机会一定补上,谢谢
...全文
105 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
山东蓝鸟贵薪 2012-05-07
  • 打赏
  • 举报
回复
怎么看也是XML格式的文件呀
wzca 2012-05-07
  • 打赏
  • 举报
回复
重新引入一次wsdl.是不是WSDL有变化了
PhoenixTR 2012-05-04
  • 打赏
  • 举报
回复
WSDLImp http://localhost:4317/Service1.asmx?wsdl
用这个命令来生成单元文件,就不会出错了

5,388

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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