Again I am back with a question related to the same wsdl, this time wanted to remove all namespaces in the request, and conforming to the wsdl.
The same wsdl tripservice wsdl from the link ,simply replace the “from” element with the below.
<xs:element minOccurs="0" name="from" nillable="true">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
<xs:maxLength value="12"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
Using soapui we know that the below request xml conforms to wsdl.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:trip="http://trip.price.service" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header/>
<soapenv:Body>
<trip:getTripPrice>
<trip>
<adults>9</adults>
<duration>9</duration>
<from xsi:nil="true" />
<rooms>3</rooms>
</trip>
</trip:getTripPrice>
</soapenv:Body>
</soapenv:Envelope>
I removed almost all namespaces from the request, however not able to remove xsi namespace from the request, so as to conform to wsdl
<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Header/>
<Body>
<getTripPrice xmlns="http://trip.price.service">
<trip xmlns="">
<adults>9</adults>
<duration>9</duration>
<from xsi:nil="true" />
<rooms>3</rooms>
</trip>
</getTripPrice>
</Body>
</Envelope>
How to remove xsi namespace as well, still valid as per the wsdl?
This is a generic XML processing question, “How do you control the use and production of namespace prefixes in XML producer ‘x'”? In your case, according to the comments, ‘xml producer X is xslt.’ It will then depend on what implementation of XSLT you are using and whether it has any options to control this particular behavior.
In general, xslt takes the usual attitude that namespace prefixes are just syntactic sugar, and does not offer convenient mechanisms for controlling their use. You may be able to encourage it make more use of prefixes by declaring them at the top of your XSLT definition.
I recommend compression as the real solution to reducing bandwidth usage.