DanielWu

絶えず学んで、絶えず考える.

导航

公告

随笔分类

随笔档案

相册

最新评论

统计

常用链接

阅读排行榜

评论排行榜

Delphi 写的Web Service 返回复杂类型的数据结构,.Net 和 Java 不能正常调用的问题。

这几天被Delphi Soap弄得头痛死了。我用Delphi开发的Web Service 不能被Java or Dot Net 的客户端实现的问题。我发现当soap返回复杂类型的结构时,Java or Dot Net 就认不出来,但是Delphi自己可以认出来,我感
到非常奇怪。于是把XML的Response也截取了下来。
错误信息如下:
An unhandled exception of type 'System.InvalidOperationException' occurred in system.xml.dll

Additional information: XML 文档(2, 763)中有错误。

HTTP/1.1 200 OK
Content-Type: text/xml
Content-Length: 740
Content:

<?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 SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
        
<NS1:WS_Test_User_LoginResponse xmlns:NS1="urn:MMOPWSIntf-IMMOPWS" xmlns:NS2="urn:unitDataType">
            
<return href="#1" />
            
<NS2:T_Test_User_Login id="1" xsi:type="NS2:T_Test_User_Login">
                
<Auth_Result xsi:type="xsd:string">T</Auth_Result>
                
<Cons_Name xsi:type="xsd:string">XXX</Cons_Name>
            
</NS2:T_Test_User_Login>
        
</NS1:WS_Test_User_LoginResponse>
    
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

找了几天都没有发现什么问题,非常郁闷。后来在我的师傅齐琪的帮助下,终于解决了。
我的师傅真厉害阿。
答案如下:
Despite the claims of interoperability there are many compatibility issues
with Delphi and .Net.  To fix this problem make sure to set the soap convert
options to soRootRefNodestoBody to true in the Pascal Invoker component.

posted on 2004-07-15 09:10 DanielWu 阅读(2288) 评论(2) 编辑 收藏