Sebastian Brandt created AXIS2C-1593: ----------------------------------------
Summary: Strange handling of xsi:type in requests Key: AXIS2C-1593 URL: https://issues.apache.org/jira/browse/AXIS2C-1593 Project: Axis2-C Issue Type: Bug Components: xml/om Affects Versions: 1.7.0 Reporter: Sebastian Brandt Priority: Minor When creating the SOAP xml for a request, the xsi namespace tag is overridden with the target type namespace, thus, giving "xsi:type" a different meaning. Interestingly, this code is accepted by a .Net WCF service. Request xml (excerpt): <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Body> <n:tellCurrentProcessValuesExn xsi:type="ExnProcessValuesDto" xmlns:xsi="http://company/ISP/" xmlns:n="http://company/ISP/"> <n:cpv xsi:type="ExnProcessValuesDto"> <n:CustomerName>Kundenname</n:CustomerName> ... </n:cpv> </n:tellCurrentProcessValuesExn> </soapenv:Body> </soapenv:Envelope> It seems that the xsi namespace is first overridden from http://www.w3.org/2001/XMLSchema-instance to the web service namespace; then, xsi:type="NonQualName" is used. There, the corrent namespace is missing from the name; instead, the service seems to take the namespace from the xsi, ignoring the fact that the xsi:type attribute is not actually http://www.w3.org/2001/XMLSchema-instance#type, but http://company/ISP/type. I found this problem when trying to reduce the memory leaks in #AXIS2C-1591; there, the xsi om_element->namespaces hash entry is overwritten, from http://www.w3.org/2001/XMLSchema-instance to http://company/ISP/. If this overwriting is not done, the following SOAP results: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Body> <n:tellCurrentProcessValuesExn xsi:type="ExnProcessValuesDto" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:n="http://company/ISP/"> <n:cpv xsi:type="ExnProcessValuesDto"> <n:CustomerName>Kundenname</n:CustomerName> ... which uses xsi:type correctly, but does not have a namespace for ExnProcessValuesDto, thus, resulting in a server error. ":ExnProcessValuesDto" is not known to the service. I am not sure in how far <n:tellCurrentProcessValuesExn xsi:type="n:ExnProcessValuesDto" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:n="http://company/ISP/"> would be the correct fragment. WSDL (excerpt): ... xmlns:tns="http://company/ISP/" ... ... <xsd:element name="tellCurrentProcessValuesExn"> <xsd:complexType> <xsd:sequence> <xsd:element minOccurs="0" name="cpv" nillable="true" type="tns:ExnProcessValuesDto"/> </xsd:sequence> </xsd:complexType> </xsd:element> ... <xsd:complexType name="StdProcessValuesDto"> <xsd:sequence> <xsd:element minOccurs="0" name="CustomerName" nillable="true" type="xsd:string"/> ... </xsd:sequence> </xsd:complexType> <xsd:element name="StdProcessValuesDto" nillable="true" type="tns:StdProcessValuesDto"/> ... <xsd:complexType name="ExnProcessValuesDto"> <xsd:complexContent mixed="false"> <xsd:extension base="tns:StdProcessValuesDto"> <xsd:sequence> <xsd:element minOccurs="0" name="Components" nillable="true" type="tns:ArrayOfExnComponentDto"/> ... </xsd:sequence> </xsd:extension> </xsd:complexContent> </xsd:complexType> <xsd:element name="ExnProcessValuesDto" nillable="true" type="tns:ExnProcessValuesDto"/> -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: c-dev-unsubscr...@axis.apache.org For additional commands, e-mail: c-dev-h...@axis.apache.org