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 Alan May <al...@PeopleAdmin.com> on 2005/11/04 21:38:45 UTC

AXIS 1.3 Client stub... hoping to spit out slightly different soap header output

Newbie axis question:
 
Environment:
AXIS 1.3
JDK 1.4.2
Client stub generated from WSDL using WSDL2Java
 
Instead of...
 
<soap:Header>
<ns1:wsConsumerCredential
soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next"
soapenv:mustUnderstand="0" xmlns:ns1="http://myhost.com/ws/">
<password>XXXX</password>
<id>YYYY</id>
</ns1:wsConsumerCredential>
</soapenv:Header>
 
Is it possible to get this result?
<soap:Header>

<wsConsumerCredential xmlns="http://myhost.com/ws/">

<password>XXXX</password>

<id>YYYY</id>

</wsConsumerCredential>

<soap:Header>

 

My client of the generated webservice stub class currently uses the
following:
 
QName qnWSConsCreds = new QName("http://myhost.com/ws/",
   "wsConsumerCredential");
   
   SOAPHeaderElement she = new SOAPHeaderElement(qnWSConsCreds);
   SOAPElement passwordElement = she.addChildElement("password", "");
   passwordElement.addTextNode("XXXX");
   SOAPElement idElement = she.addChildElement("id", "");
   idElement.addTextNode("YYYY");
 
 

 

Re: AXIS 1.3 Client stub... hoping to spit out slightly different soap header output

Posted by Anne Thomas Manes <at...@gmail.com>.
Note that the two headers are not equivalent. In the first structure,
<password> and <id> are unqualified. In the second structure they are
qualified. What does your schema say?

And why do you care whether the header uses a default namespace rather than
a prefixed namespace?

Anne

On 11/4/05, Alan May <al...@peopleadmin.com> wrote:
>
> Newbie axis question:
>  Environment:
> AXIS 1.3
> JDK 1.4.2
> Client stub generated from WSDL using WSDL2Java
>  Instead of...
>  <soap:Header>
> <ns1:wsConsumerCredential soapenv:actor="
> http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0"
> xmlns:ns1="http://myhost.com <http://myhost.com>/ws/">
> <password>XXXX</password>
> <id>YYYY</id>
> </ns1:wsConsumerCredential>
> </soapenv:Header>
>  Is it possible to get this result?
>
> <soap:Header>
>
> <wsConsumerCredential xmlns="http://myhost.com <http://myhost.com>/ws/">
>
> <password>XXXX
> </password>
>
> <id>YYYY</id>
>
> </wsConsumerCredential>
>
> <soap:Header>
>
>  My client of the generated webservice stub class currently uses the
> following:
>  QName qnWSConsCreds = new QName("http://myhost.com/ws/",
> "wsConsumerCredential");
>
> SOAPHeaderElement she = new SOAPHeaderElement(qnWSConsCreds);
> SOAPElement passwordElement = she.addChildElement("password", "");
> passwordElement.addTextNode("XXXX");
> SOAPElement idElement = she.addChildElement("id", "");
> idElement.addTextNode("YYYY");
>
>