Hello everyone,
I have been given by a partner a WSDL for their Web Services. I'm not too experienced with Web Services, so I'm a bit skeptical about something with the WSDL. One particular method allows us to get some information, but we can only use it once (or face a penalty.) The problem is that it is returned as "raw XML" inside the SOAP response, so I'm not exactly sure what will be returned, and thus how to deal with it and properly store it.
The relevant part of the WSDL is this:
<s:element name="MethodResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="MethodResult">
<s:complexType mixed="true">
<s:sequence>
<s:any />
</s:sequence>
</s:complexType>
</s:element>
</s:sequence>
</s:complexType>
</s:element>
wsimport generated the following class:
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"methodResult"
})
@XmlRootElement(name = "MethodResponse")
public class MethodResponse {
@XmlElement(name = "MethodResult")
protected MethodResponse.MethodResult methodResult;
public MethodResponse.MethodResult getMethodResult() {
return methodResult;
}
public void setMethodResult(MethodResponse.MethodResult value) {
this.methodResult = value;
}
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"content"
})
public static class MethodResult {
@XmlMixed
@XmlAnyElement(lax = true)
protected List<Object> content;
public List<Object> getContent() {
if (content == null) {
content = new ArrayList<Object>();
}
return this.content;
}
}
}
So the question is, what will be the class of the objects returned by getContent()? A sample C# sample that they provided doesn't have a MethodResponse or MethodResult, but the return type is just XmlNode.
BTW, even though the code was generated by wsimport, the application uses Axis2. The other methods available return proper objects.
A simple test (sample server running on Mono) generated an exception on the client side:
Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: Could not deserialize Soap message
Thanks in advance.