1
我實現SOAP客戶端現有的服務,我有WSDL文件。SOAP href XML映射問題 - 哪種映射有幫助?
我使用的Axis2 - http://axis.apache.org/axis2/java/
我在與映射到類問題: WSDL只指定了3種可能的對策:
<wsdl:types>
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://request.pgw.muzo.com">
<import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
<complexType name="Response">
<sequence>
<element name="digest" nillable="true" type="xsd:string"/>
<element name="ok" type="xsd:boolean"/>
<element name="primaryReturnCode" type="xsd:int"/>
<element name="secondaryReturnCode" type="xsd:int"/>
<element name="requestId" type="xsd:long"/>
</sequence>
</complexType>
<complexType name="OrderResponse">
<complexContent>
<extension base="tns2:Response">
<sequence>
<element name="orderNumber" nillable="true" type="xsd:string"/>
</sequence>
</extension>
</complexContent>
</complexType>
<complexType name="OrderStateResponse">
<complexContent>
<extension base="tns2:OrderResponse">
<sequence>
<element name="state" type="xsd:int"/>
</sequence>
</extension>
</complexContent>
</complexType>
</schema>
</wsdl:types>
但實際的反應是有點複雜,實際響應不在元素中,但elemnt通過它的id包含屬性soap:href reffering to soap:multiRef元素。 (肥皂是http://schemas.xmlsoap.org/soap/envelope/)
<soapenv:Body>
<ns1:queryOrderStateResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="http://webservices.pgw.muzo.com">
<queryOrderStateReturn href="#id0" />
</ns1:queryOrderStateResponse>
<multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="ns2:OrderStateResponse" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://request.pgw.muzo.com">
<digest xsi:type="soapenc:string">AAA</digest>
<ok href="#id1" />
<orderNumber xsi:type="soapenc:string">232</orderNumber>
<primaryReturnCode href="#id2" />
<secondaryReturnCode href="#id3" />
<state href="#id4" />
<requestId href="#id5" />
</multiRef>
...
</soapenv:Body>
這種行爲是正常的嗎? (軸允許我使用xmlbeans或adb映射,但不是這個工程)
我沒有太多的XML,所以我不舒服如果href如果標準或不。 (我不能更改的服務!)