请教一个web service 用类做参数出现的问题!
fosil 2003-11-19 02:21:17 当用 THTTPRIO 控件调用函数
AddBook(const UserID:String;cBook:Book)时,
向服务器端传递以下内容:
<?xml version="1.0" encoding='UTF-8'?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/1999/XMLSchema"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<NS1:AddBook xmlns:NS1="urn:bookshop-service"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:NS2="urn:bookshop-book">
<NS1:UserID xsi:type="xsd:string">111111</NS1:UserID>
<NS2:book xsi:type="NS2:Book">
<NS2:author xsi:type="xsd:string">authorname</NS2:author>
<NS2:bookName xsi:type="xsd:string">the book name</NS2:bookName>
<NS2:publisher xsi:type="xsd:string">wwwwwww</NS2:publisher>
</NS2:book>
</NS1:AddBook>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
服务器端是用Apache SOAP,
出现以下错误:
java.lang.IllegalArgumentException: Unable to retrieve PropertyDescriptor for property 'NS2:author' of class 'class wisdom.Book'.
我想这应该将“<NS2:author xsi:type="xsd:string">authorname</NS2:author>”
中的“NS2”去掉就可以了,而且我试过如果从服务器端返回Book类的时候是“<author xsi:type="xsd:string">authorname</author>”的。
但是怎么控制THTTPRIO不添加“NS2” 呢?