SOAP href XML mapping problem - which mapping helps?
I'm implementing SOAP client to existing service of which i have WSDL file.
I use axis2 - http://axis.apache.org/axis2/java/
I'm having problem with the mapping to classes: WSDL specifies just 3 possible responses:
<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>
But the actual response is a bit complicated, actual response is not in the element but the elemnt contains attribute soap:href reffering to soap:multiRef element via it's id. (soap being 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" soape开发者_如何学JAVAnv: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>
Is this behaviour normal? (axis allows me to use xmlbeans or adb mapping but non of this works)
I'm not much into XML, so i'm not shure if href if standard or not. (I cant change the service!)
It's RPC/Encoded format of SOAP which is no longer supported by main frameworks. you have to use Axis (1) to deal with thi stuff.
精彩评论