I'm encountering a very frustrating issue. All XML responses from the service are wrapped under the same element ("response"). For example, if I login, I will get a "response", not a "loginResponse". If I search something, I will also get "response", not "searchResponse".
All responses have this structure:
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<response method="methodName">
<payload>
** other elements**
</payload>
</response>
</S:Body>
</S:Envelope>
Why is this a problem? Well, all my proxy classes expect an element to deserialze, as such:
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("urn:xxx-premium#xxxLogin", Use=System.Web.Services.Description.SoapBindingUse.Literal,ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Bare)]
[return: System.Xml.Serialization.XmlElementAttribute("response", Namespace="")]
**random method**
The issue is that, if all element names have the same name, I will get an exception such as :
InvalidOperationException: The top XML element 'response' from namespace '' references distinct types
It makes sense, since this mechanism uses reflection. The XML response has no namespace as well.
For your info: I used the old wsdl.exe (web reference) since using Svcutil did not work.
Upon running assertion tests in SoapUI, I also received a "schema compliance: FAILED" message.
Obviously, changing the name in the proxy code will cause the response to be null.
Is there a solution to this or the only option is to contact the provider to change their nightmare of a service?