Delphi 调用java开发的webservice(20分)

  • 主题发起人 主题发起人 helium-he
  • 开始时间 开始时间
H

helium-he

Unregistered / Unconfirmed
GUEST, unregistred user!
delphi调用java+tomcat开发的webservice,出现问题:
"Message part was not recognized"
哪位大侠知道?

另delphi调用java开发的webservice,需要注意哪些?

谢谢
 
没有人用过delphi调用webservice?
帮帮忙,各位大侠!!
 
什么开发的webservice调用方法都一样吧。
 
Delphi调用WSDL发送的soap包
<?xml version="1.0"?>
<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><posBalanceQuery xmlns="http://webservices.posfee.bjx.com/"><arg0>123456</arg0></posBalanceQuery></SOAP-ENV:Body></SOAP-ENV:Envelope>

////////////////////////////////////////////
SOAP UI调用WSDL发送的SOAP包
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://webservices.posfee.bjx.com/">
<soapenv:Header/>
<soapenv:Body>
<web:posBalanceQuery>
<!--Optional:-->
<arg0 >123456</arg0>
</web:posBalanceQuery>
</soapenv:Body>
</soapenv:Envelope>

为什么delphi发送的数据包返回"fault occurred while processing",而后者有返回正常?
 
Delphi调用java开发的webservice
如果设置为:InvRegistry.RegisterInvokeOptions(TypeInfo(PosFeeServer),ioLiteral);
发送的SOAP包为
<?xml version="1.0"?>
<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" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<arg0 xsi:type="xsd:string">123456</arg0>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

少了函数名<posBalanceQuery>

如果设置为:InvRegistry.RegisterInvokeOptions(TypeInfo(PosFeeServer),ioDocument);
发送的SOAP包为:
<?xml version="1.0"?>
<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>
<posBalanceQuery xmlns="http://webservices.posfee.bjx.com/">
<arg0>123456</arg0>
</posBalanceQuery>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
其中<posBalanceQuery xmlns="http://webservices.posfee.bjx.com/">多了xmlns="http://webservices.posfee.bjx.com/"而不能识别.

请问要怎么设置?
 
Delphi 调用java开发的WEBSERVICE,有时服务端不是返回想要的数据,而是返回异常/错误提示响应,如下:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body><soap:Fault><faultcode>soap:Server</faultcode><faultstring>密码错误!</faultstring>
</soap:Fault>
</soap:Body>
</soap:Envelope>
要怎么才能捕获到异常(如密码错误!),而使程序不弹出错误框"密码错误!"
 
你用的是D的那个版本,D6调用的话很多问题的.D7就比较好.
 
后退
顶部