fml2the
10 years agoNew Contributor
Header part generated also in body in sample request
Hello.
I noticed the following behaviour. In my WSDL (v. 1.1), a have a message element with two parts, name them "headerPart" and "bodyPart":
[code=php:1t0gx157] <message name="GetLastTradePriceInput">
<part name="bodyPart" element="xsd1:TradePriceRequest"/>
<part name="headerPart" element="xsd1:HeaderElement"/>
</message> [/code:1t0gx157]
In the binding section, I have the following, i.e. the "headerPart" should go to the SOAP header, and the bodyPart should go to the SOAP body:
[code=php:1t0gx157] <input>
<soap:header message="tns:GetLastTradePriceInput" part="headerPart" use="literal"/>
<soap:body message="tns:GetLastTradePriceInput" part="bodyPart" use="literal"/>
</input> [/code:1t0gx157]
But in the sample request generated by SoapUI (I tried 4.6.1 and 5.0.0), the HeaderElement is generated both in the header and in the body of the SOAP request, i.e. I get this:
[code=php:1t0gx157]<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:stoc="http://example.com/stockquote.xsd">
<soapenv:Header>
<stoc:HeaderElement>
<value>?</value>
</stoc:HeaderElement>
</soapenv:Header>
<soapenv:Body>
<stoc:TradePriceRequest>
<tickerSymbol>?</tickerSymbol>
</stoc:TradePriceRequest>
<stoc:HeaderElement>
<value>?</value>
</stoc:HeaderElement>
</soapenv:Body>
</soapenv:Envelope> [/code:1t0gx157]
Is this correct? Shouldn't the HeaderElement be generated in the SOAP Header only?
I attach the whole sample WSDL file (copied from Wikipedia and adjusted to have a two part message)
I noticed the following behaviour. In my WSDL (v. 1.1), a have a message element with two parts, name them "headerPart" and "bodyPart":
[code=php:1t0gx157] <message name="GetLastTradePriceInput">
<part name="bodyPart" element="xsd1:TradePriceRequest"/>
<part name="headerPart" element="xsd1:HeaderElement"/>
</message> [/code:1t0gx157]
In the binding section, I have the following, i.e. the "headerPart" should go to the SOAP header, and the bodyPart should go to the SOAP body:
[code=php:1t0gx157] <input>
<soap:header message="tns:GetLastTradePriceInput" part="headerPart" use="literal"/>
<soap:body message="tns:GetLastTradePriceInput" part="bodyPart" use="literal"/>
</input> [/code:1t0gx157]
But in the sample request generated by SoapUI (I tried 4.6.1 and 5.0.0), the HeaderElement is generated both in the header and in the body of the SOAP request, i.e. I get this:
[code=php:1t0gx157]<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:stoc="http://example.com/stockquote.xsd">
<soapenv:Header>
<stoc:HeaderElement>
<value>?</value>
</stoc:HeaderElement>
</soapenv:Header>
<soapenv:Body>
<stoc:TradePriceRequest>
<tickerSymbol>?</tickerSymbol>
</stoc:TradePriceRequest>
<stoc:HeaderElement>
<value>?</value>
</stoc:HeaderElement>
</soapenv:Body>
</soapenv:Envelope> [/code:1t0gx157]
Is this correct? Shouldn't the HeaderElement be generated in the SOAP Header only?
I attach the whole sample WSDL file (copied from Wikipedia and adjusted to have a two part message)