You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Küst Heiko <he...@winterthur.ch> on 2005/03/18 11:19:20 UTC

soap header binding

hi,

a question about headers: when i define a header (some type with some
attributes) and define the binding for that header to be soap-encoded, the
multiRef reference to the header goes to the soap-body (*) which means that
the header information is splitted up between soap-header and soap-body:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<soapenv:Header>
(*)		<ns1:soaBaseHeader
soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next"
soapenv:mustUnderstand="0" href="#id0"
xmlns:ns1="urn://winterthur/com/soa/base/xsd"/>
	</soapenv:Header>
	<soapenv:Body>
		<ns2:updatePartnerAddressInfo
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns2="urn://winterthur/com/partner/PartnerModify">
			<partnerAddressInfo href="#id1"/>
		</ns2:updatePartnerAddressInfo>
(*)		<multiRef id="id0" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="ns3:SOABaseHeader"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns3="urn://winterthur/com/soa/base/xsd">
			<BaseHeaderVersion xsi:type="xsd:string"
xsi:nil="true"/>
			... other attributes ...
		</multiRef>
		<multiRef id="id1" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="ns4:PartnerAddressInfo"
xmlns:ns4="urn://winterthur/com/partner/PartnerModify/xsd"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
			<streetName
xsi:type="xsd:string">R&#xF6;merstrasse</streetName>
			... other attributes ...
		</multiRef>
		<multiRef id="id2" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="xsd:int"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">8500</multiRef>
	</soapenv:Body>
</soapenv:Envelope>

is this a correct behaviour? shouldn't all header-information appear in the
soap-header?

if i use literal for the header binding, the body binding automatically
seems to be literal too...

thanks for your help

heiko

Re: soap header binding

Posted by Anne Thomas Manes <at...@gmail.com>.
You should not use soap encoding for headers. 

>From the WSDL 1.1 spec, Section 3.7 soap:header and soap:headerfault:

"The use, encodingStyle and namespace attributes are all used in the
same way as with soap:body (see section 3.5), only style="document" is
assumed since headers do not contain parameters."

Please log a bug about the automatic literal binding of the body.

Thanks,
Anne

On Fri, 18 Mar 2005 11:19:20 +0100, Küst Heiko
<he...@winterthur.ch> wrote:
> hi,
> 
> a question about headers: when i define a header (some type with some
> attributes) and define the binding for that header to be soap-encoded, the
> multiRef reference to the header goes to the soap-body (*) which means that
> the header information is splitted up between soap-header and soap-body:
> 
> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
>         <soapenv:Header>
> (*)             <ns1:soaBaseHeader
> soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next"
> soapenv:mustUnderstand="0" href="#id0"
> xmlns:ns1="urn://winterthur/com/soa/base/xsd"/>
>         </soapenv:Header>
>         <soapenv:Body>
>                 <ns2:updatePartnerAddressInfo
> soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> xmlns:ns2="urn://winterthur/com/partner/PartnerModify">
>                         <partnerAddressInfo href="#id1"/>
>                 </ns2:updatePartnerAddressInfo>
> (*)             <multiRef id="id0" soapenc:root="0"
> soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> xsi:type="ns3:SOABaseHeader"
> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
> xmlns:ns3="urn://winterthur/com/soa/base/xsd">
>                         <BaseHeaderVersion xsi:type="xsd:string"
> xsi:nil="true"/>
>                         ... other attributes ...
>                 </multiRef>
>                 <multiRef id="id1" soapenc:root="0"
> soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> xsi:type="ns4:PartnerAddressInfo"
> xmlns:ns4="urn://winterthur/com/partner/PartnerModify/xsd"
> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
>                         <streetName
> xsi:type="xsd:string">R&#xF6;merstrasse</streetName>
>                         ... other attributes ...
>                 </multiRef>
>                 <multiRef id="id2" soapenc:root="0"
> soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> xsi:type="xsd:int"
> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">8500</multiRef>
>         </soapenv:Body>
> </soapenv:Envelope>
> 
> is this a correct behaviour? shouldn't all header-information appear in the
> soap-header?
> 
> if i use literal for the header binding, the body binding automatically
> seems to be literal too...
> 
> thanks for your help
> 
> heiko
>