问题
Please see the excerpt from my WSDL and SOAP response.
WSDL Definition:
----------------
<xs:complexType name="ContactInformation">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="AddressInfo"
nillable="true" type="AddressInfo" />
</xs:sequence>
</xs:complexType>
SOAP Response:
--------------
<contactInformation>
<addressInfo>
</addressInfo>
</contactInformation>
Although in the WSDL the element name is "AddressInfo" (A is capital), the generated response is having the element name as "addressInfo". This is creating issue, as the existing consumer is using getElementsByTagName("AddressInfo") which is case sensitive, and I should not change the consumer code.
Please let me know what should I do to resolve the issue?
回答1:
At the risk of stating the obvious, change "addressInfo" into "AddressInfo". Let us know if you need an XSLT stylesheet to do it.
来源:https://stackoverflow.com/questions/12278768/axis2-soap-response-element-name-camel-case-issue