You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@axis.apache.org by "Robert Lazarski (Jira)" <ji...@apache.org> on 2026/01/25 04:56:00 UTC

[jira] [Resolved] (AXIS2C-1593) Strange handling of xsi:type in requests

     [ https://issues.apache.org/jira/browse/AXIS2C-1593?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Robert Lazarski resolved AXIS2C-1593.
-------------------------------------
    Fix Version/s: 2.0.0
                       (was: 1.7.0)
       Resolution: Duplicate

duplicate of AXIS2C-1579 

> 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
>             Fix For: 2.0.0
>
>
> 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 was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: c-dev-help@axis.apache.org