Forum Discussion

TonyMarston's avatar
TonyMarston
New Contributor
15 years ago

Request elements are namespace qualified in error

I noticed this error in SoapUI 3.5, and it still exists in SoapUI 3.6 Beta 2.

I am using a 3rd party WSDL which uses the defaults of elementFormDefault="unqualified" and attributeFormDefault="unqualified". This is supposed to mean that on all soap requests only the first element in the body need be namespace-qualified, yet when I view a request it shows a subordinate element has also been qualified when it should not have been. Instead of
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:flt="http://www.lagan.com/wsdl/FLTypes">
<soapenv:Header/>
<soapenv:Body>
<flt:FWTCaseEformNew>
<CaseReference>?</CaseReference>
<EformName>?</EformName>
<!--Optional:-->
<URL>?</URL>
</flt:FWTCaseEformNew>
</soapenv:Body>
</soapenv:Envelope>

it shows
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:flt="http://www.lagan.com/wsdl/FLTypes">
<soapenv:Header/>
<soapenv:Body>
<flt:FWTCaseEformNew>
<flt:CaseReference>?</flt:CaseReference>
<EformName>?</EformName>
<!--Optional:-->
<URL>?</URL>
</flt:FWTCaseEformNew>
</soapenv:Body>
</soapenv:Envelope>

The element CaseReference does not have the form="qualified" attribute to override the default setting, therefore it should not be qualified.

This is causing a problem as my software generates soap requests using the specifications in the WSDL file which state that only the top-level element in the soap body need be qualified, but the soap server is rejecting the request because a child element is not qualified.

If I have generated a request which is valid according to the WSDL specifications then it should not be rejected.

The only way I can get around this is to use a local patched copy of the WSDL file in which I have added form="qualified" to the affected elements, but this means that I have to create a new patched file each time they change their WSDL.

1 Reply

  • I am see the same thing in version 4.0.1

    This 3rd-party WSDL includes the following text on line 12:
    attributeFormDefault="unqualified"
    which means that if the attribute "operationType" is not marked "Form=qualified" elsewhere then it should not appear with a namespace prefix (e.g. ns1:) but it does. I know the soapUI developers probably do not want to change this, but this functionality should be selectable in "preferences".

    <?xml version="1.0" encoding="utf-8"?>
    <wsdl:definitions
    xmlns:tns="http://xyz.com"
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    name="Untitled" targetNamespace="http://xyz.com">
    <wsdl:types>
    <xs:schema
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://xyz.com"
    elementFormDefault="qualified"
    attributeFormDefault="unqualified">
    <xs:element name="out" type="xs:string" />
    <xs:element name="pushReply" type="tns:reply" />
    <xs:element name="pushReplyResponse" type="tns:replyResponse" />
    <xs:attribute name="operationType">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:enumeration value="INSERT" />
    <xs:enumeration value="UPDATE" />
    </xs:restriction>
    </xs:simpleType>
    </xs:attribute>
    <xs:complexType name="reply">
    <xs:choice>
    <xs:element name="replyElement" type="tns:replyElement" />
    </xs:choice>
    <xs:attribute name="requestGuid" use="required" form="qualified" type="xs:string" />
    <xs:attribute name="source" use="required" form="qualified" type="xs:string" />
    </xs:complexType>
    <xs:complexType name="replyElement">
    <xs:sequence>
    <xs:element name="warning" type="tns:warning" minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>
    <xs:attribute name="itsmId" use="required" form="qualified" type="xs:string" />
    <xs:attribute ref="tns:operationType" use="required" />
    <xs:attribute name="recordId" use="required" form="qualified" type="xs:string" />
    </xs:complexType>
    <xs:complexType name="replyResponse">
    <xs:attribute name="requestGuid" form="qualified" type="xs:string" />
    </xs:complexType>
    <xs:complexType name="warning">
    <xs:attribute name="code" form="qualified" type="xs:string" />
    <xs:attribute name="message" form="qualified" type="xs:string" />
    </xs:complexType>
    <xs:element name="reply" type="tns:reply" />
    <xs:element name="replyResponse" type="tns:replyResponse" />
    </xs:schema>
    </wsdl:types>
    <wsdl:service name="requestWSDL.serviceagent">
    <wsdl:port name="requestWSDLSOAP" binding="tns:requestWSDLSOAPBinding">
    <soap:address location="http://0.0.0.0:9001/requestWSDL" />
    </wsdl:port>
    </wsdl:service>
    <wsdl:portType name="requestWSDL">
    <wsdl:operation name="pushReply">
    <wsdl:input message="tns:pushReplyRequest" />
    <wsdl:output message="tns:pushReplyResponse" />
    </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="requestWSDLSOAPBinding" type="tns:requestWSDL">
    <soap:binding style="document"
    transport="http://schemas.xmlsoap.org/soap/http" />
    <wsdl:operation name="pushReply">
    <soap:operation style="document" soapAction="/pushReply" />
    <wsdl:input>
    <soap:body use="literal" parts="parameters" />
    </wsdl:input>
    <wsdl:output>
    <soap:body use="literal" parts="parameters" />
    </wsdl:output>
    </wsdl:operation>
    </wsdl:binding>
    <wsdl:message name="pushReplyRequest">
    <wsdl:part name="parameters" element="tns:pushReply" />
    </wsdl:message>
    <wsdl:message name="pushReplyResponse">
    <wsdl:part name="parameters" element="tns:pushReplyResponse" />
    </wsdl:message>
    </wsdl:definitions>