Assuming you are using the RPC API, here's what I would try

    1. Create the DOM fragment you show below, the channel credentials
element with 3 children.
    2. Create an org.apache.soap.Header
    3. Create a Vector with one element containing the Element from #1
    4. Pass the Vector to Header#setHeaderEntries
    5. Pass the Header to Call#setHeader

Scott Nichol

----- Original Message -----
From: "Dan Allen" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, September 23, 2002 11:22 AM
Subject: RE: SOAP Headers


>
> I can't help with examples but the general idea is to use the
Envelope.setEnvelopeEntries()
> method to add the headers.  IIRC the argument is a Vector of DOM Elements
to be used as
> header entries.  I also seem to recall that this is an all-or-none
operation.  Whatever you
> pass in replaces anything already there so you should call
getEnvelopeEntries() to obtain any
>       existing header entries, add your headers to the set returned, and
then call the set method.
>
> Hope this helps. It's all from recollection of the source code and the
Docs are not useful
> so I'd suggest you peruse the source yourself for a definitive answer.
>
> Dan
>
> > -----Original Message-----
> > From: Martin Pichardo [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, September 23, 2002 8:30 AM
> > To: [EMAIL PROTECTED]
> > Subject: SOAP Headers
> >
> >
> > Hello,
> >
> > I am trying to consume a .Net web service with the Apache soap toolkit.
The
> > web service is expecting the following header:
> >
> > <tns:sdpChannelCredentials id="id1">
> >   <UserName xsi:type="xsd:string">Martin Pichardo</UserName>
> >   <UserSecurityToken xsi:type="xsd:string">Password</UserSecurityToken>
> >   <UserServiceChannel xsi:type="xsd:string">any
text</UserServiceChannel>
> > </tns:sdpChannelCredentials>
> >
> > I haven't been able to create a soap hearder with the toolkit. Can
anyone
> > provide a code snippet for creating the soap header as illustrated
above.
> >
> > any suggestions are appreciated,
> >
> > Thanks,
> >
> > Martin
> >
> >
> > _________________________________________________________________
> > Send and receive Hotmail on your mobile device: http://mobile.msn.com
> >
> >
> > --
> > To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
> >
>
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to