You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@ws.apache.org by Olivier Reisacher <ol...@cegetel.fr> on 2002/08/06 09:27:21 UTC

How to add attributes in the SOAP HEADER?

Hello,

I am using Apache SOAP 2.3.1

I have searched the doc and the mailing list archives
and I did not find any working code.
(similar questions have already been posted on SOAP-DEV)

Any ideas?

Thank you for your help.

	Olivier Reisacher



Ouch the call failed

Posted by dovle <do...@delsyne.ro>.
Hi all,
I have a small problem:
when deploying I get (only from time to time) an:

Ouch, the call failed:
  Fault Code   = SOAP-ENV:Client
  Fault String = Deployment error in SOAP service
'urn:xml-soap-service-manageme
nt-service': class name 'org.apache.soap.encoding.soapenc.BeanSerializer'
could
not be resolved as a serializer:
org.apache.soap.encoding.soapenc.BeanSerializer

BUT ONLY FROM TIME TO TIME.
Can you tell me why does this happens ?

Thanks alot
dovle


Ouch the call failed

Posted by dovle <do...@delsyne.ro>.
Hi all,
I have a small problem:
when deploying I get (only from time to time) an:

Ouch, the call failed:
  Fault Code   = SOAP-ENV:Client
  Fault String = Deployment error in SOAP service
'urn:xml-soap-service-manageme
nt-service': class name 'org.apache.soap.encoding.soapenc.BeanSerializer'
could
not be resolved as a serializer:
org.apache.soap.encoding.soapenc.BeanSerializer

BUT ONLY FROM TIME TO TIME.
Can you tell me why does this happens ?

Thanks alot
dovle


--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>


RE: How to add attributes in the SOAP HEADER?

Posted by Dan Allen <da...@nist.gov>.
	The setHeaderEntries() method adds DOM elements as children of the
      SOAP Header element. The setAttribute() method adds an XML attribute
      to the SOAP Header element.  These are two different things.

	To add a namespace attribute to the SOAP header use setAttribute() with
      the appropriate QNAME (i.e "xmlns:foo") and the target namespace URI
      (i.e. "http://thefoonamespace"). I haven't actually checked this with
	the "xmlns" prefix but it should work.

      If you want to add Header elements with the their namespace declaration
      on their invocation rather than on the SOAP Header element simply create
      the child DOM element with the desired namespace declaration (i.e.
	document.createElementNS("foo:myHeaderElement", "http://thefoonamespace")
      and use addHeaderEntries to add it as a child of the SOAP Header element.

> -----Original Message-----
> From: Olivier Reisacher [mailto:olivier.reisacher@cegetel.fr]
> Sent: Thursday, August 08, 2002 10:27 AM
> To: soap-user@xml.apache.org
> Subject: RE: How to add attributes in the SOAP HEADER?
>
>
>
> Fred, Daniel
>
> Thanks for your help.
> In looking at the SOAP Apache code, I have found
> that the suggested way to add SOAP HEADERs
> is to use the Header.setHeaderEntries() method
> and not the Header.setAttribute().
> However, I did not find a way to handle namespaces.
> The solution proposed by Fred supports namespaces.
>
> Regards,
>
> 	Olivier Reisacher
>
>
> -----Message d'origine-----
> De : DAniel Allen [mailto:dallen@nist.gov]
> Envoyé : mercredi 7 août 2002 14:58
> À : soap-user@xml.apache.org
> Objet : RE: How to add attributes in the SOAP HEADER?
>
>
>
> 	Excuse me if i missed something in any of the previous threads but
> 	the Header object has a setAttribute() method which can be used to
> 	set attribute values directly.
>
> 	Dan
>
> -----Original Message-----
> From: Fred Meredith [mailto:fmeredith@nc.rr.com]
> Sent: Tuesday, August 06, 2002 4:53 PM
> To: soap-user@xml.apache.org
> Subject: Re: How to add attributes in the SOAP HEADER?
>
>
> In my application, we're using a message based SOAP service using SOAP
> Headers.  We made it work by declaring XML tags like <namespace:tagname
> xmlns:namespace="namespace uri">tagvalue</tagname>
>
> With this tag (or tags) as a String, you can do this:
>     javax.xml.parsers.DocumentBuilder xdb =
> XMLParserUtils.getXMLDocBuilder();
>     Document doc = xdb.parse(new InputSource(new
> java.io.StringReader(tagXML)));
>
>     Header msgHeader = Header.unmarshall(doc.getDocumentElement(), new
> org.apache.soap.rpc.SOAPContext());
>
>
> and then this header can be set in your Message object, using setHeader().
>
> Hope this helps,
>
>
>
> >
> > Hello,
> >
> > I am using Apache SOAP 2.3.1
> >
> > I have searched the doc and the mailing list archives
> > and I did not find any working code.
> > (similar questions have already been posted on SOAP-DEV)
> >
> > Any ideas?
> >
> > Thank you for your help.
> >
> > Olivier Reisacher
> >
> >
> >
> > --
> > To unsubscribe, e-mail:   <ma...@xml.apache.org>
> > For additional commands, e-mail: <ma...@xml.apache.org>
> >
>
>
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>
>
>
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>
>
>
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>
>


RE: How to add attributes in the SOAP HEADER?

Posted by Dan Allen <da...@nist.gov>.
	The setHeaderEntries() method adds DOM elements as children of the
      SOAP Header element. The setAttribute() method adds an XML attribute
      to the SOAP Header element.  These are two different things.

	To add a namespace attribute to the SOAP header use setAttribute() with
      the appropriate QNAME (i.e "xmlns:foo") and the target namespace URI
      (i.e. "http://thefoonamespace"). I haven't actually checked this with
	the "xmlns" prefix but it should work.

      If you want to add Header elements with the their namespace declaration
      on their invocation rather than on the SOAP Header element simply create
      the child DOM element with the desired namespace declaration (i.e.
	document.createElementNS("foo:myHeaderElement", "http://thefoonamespace")
      and use addHeaderEntries to add it as a child of the SOAP Header element.

> -----Original Message-----
> From: Olivier Reisacher [mailto:olivier.reisacher@cegetel.fr]
> Sent: Thursday, August 08, 2002 10:27 AM
> To: soap-user@xml.apache.org
> Subject: RE: How to add attributes in the SOAP HEADER?
>
>
>
> Fred, Daniel
>
> Thanks for your help.
> In looking at the SOAP Apache code, I have found
> that the suggested way to add SOAP HEADERs
> is to use the Header.setHeaderEntries() method
> and not the Header.setAttribute().
> However, I did not find a way to handle namespaces.
> The solution proposed by Fred supports namespaces.
>
> Regards,
>
> 	Olivier Reisacher
>
>
> -----Message d'origine-----
> De : DAniel Allen [mailto:dallen@nist.gov]
> Envoyé : mercredi 7 août 2002 14:58
> À : soap-user@xml.apache.org
> Objet : RE: How to add attributes in the SOAP HEADER?
>
>
>
> 	Excuse me if i missed something in any of the previous threads but
> 	the Header object has a setAttribute() method which can be used to
> 	set attribute values directly.
>
> 	Dan
>
> -----Original Message-----
> From: Fred Meredith [mailto:fmeredith@nc.rr.com]
> Sent: Tuesday, August 06, 2002 4:53 PM
> To: soap-user@xml.apache.org
> Subject: Re: How to add attributes in the SOAP HEADER?
>
>
> In my application, we're using a message based SOAP service using SOAP
> Headers.  We made it work by declaring XML tags like <namespace:tagname
> xmlns:namespace="namespace uri">tagvalue</tagname>
>
> With this tag (or tags) as a String, you can do this:
>     javax.xml.parsers.DocumentBuilder xdb =
> XMLParserUtils.getXMLDocBuilder();
>     Document doc = xdb.parse(new InputSource(new
> java.io.StringReader(tagXML)));
>
>     Header msgHeader = Header.unmarshall(doc.getDocumentElement(), new
> org.apache.soap.rpc.SOAPContext());
>
>
> and then this header can be set in your Message object, using setHeader().
>
> Hope this helps,
>
>
>
> >
> > Hello,
> >
> > I am using Apache SOAP 2.3.1
> >
> > I have searched the doc and the mailing list archives
> > and I did not find any working code.
> > (similar questions have already been posted on SOAP-DEV)
> >
> > Any ideas?
> >
> > Thank you for your help.
> >
> > Olivier Reisacher
> >
> >
> >
> > --
> > To unsubscribe, e-mail:   <ma...@xml.apache.org>
> > For additional commands, e-mail: <ma...@xml.apache.org>
> >
>
>
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>
>
>
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>
>
>
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>


RE: How to add attributes in the SOAP HEADER?

Posted by Olivier Reisacher <ol...@cegetel.fr>.
Fred, Daniel

Thanks for your help.
In looking at the SOAP Apache code, I have found
that the suggested way to add SOAP HEADERs
is to use the Header.setHeaderEntries() method
and not the Header.setAttribute().
However, I did not find a way to handle namespaces.
The solution proposed by Fred supports namespaces.

Regards,

	Olivier Reisacher


-----Message d'origine-----
De : DAniel Allen [mailto:dallen@nist.gov]
Envoyé : mercredi 7 août 2002 14:58
À : soap-user@xml.apache.org
Objet : RE: How to add attributes in the SOAP HEADER?



	Excuse me if i missed something in any of the previous threads but
	the Header object has a setAttribute() method which can be used to
	set attribute values directly.

	Dan

-----Original Message-----
From: Fred Meredith [mailto:fmeredith@nc.rr.com]
Sent: Tuesday, August 06, 2002 4:53 PM
To: soap-user@xml.apache.org
Subject: Re: How to add attributes in the SOAP HEADER?


In my application, we're using a message based SOAP service using SOAP
Headers.  We made it work by declaring XML tags like <namespace:tagname
xmlns:namespace="namespace uri">tagvalue</tagname>

With this tag (or tags) as a String, you can do this:
    javax.xml.parsers.DocumentBuilder xdb =
XMLParserUtils.getXMLDocBuilder();
    Document doc = xdb.parse(new InputSource(new
java.io.StringReader(tagXML)));

    Header msgHeader = Header.unmarshall(doc.getDocumentElement(), new
org.apache.soap.rpc.SOAPContext());


and then this header can be set in your Message object, using setHeader().

Hope this helps,



>
> Hello,
>
> I am using Apache SOAP 2.3.1
>
> I have searched the doc and the mailing list archives
> and I did not find any working code.
> (similar questions have already been posted on SOAP-DEV)
>
> Any ideas?
>
> Thank you for your help.
>
> Olivier Reisacher
>
>
>
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>



--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>



RE: How to add attributes in the SOAP HEADER?

Posted by Olivier Reisacher <ol...@cegetel.fr>.
Fred, Daniel

Thanks for your help.
In looking at the SOAP Apache code, I have found
that the suggested way to add SOAP HEADERs
is to use the Header.setHeaderEntries() method
and not the Header.setAttribute().
However, I did not find a way to handle namespaces.
The solution proposed by Fred supports namespaces.

Regards,

	Olivier Reisacher


-----Message d'origine-----
De : DAniel Allen [mailto:dallen@nist.gov]
Envoyé : mercredi 7 août 2002 14:58
À : soap-user@xml.apache.org
Objet : RE: How to add attributes in the SOAP HEADER?



	Excuse me if i missed something in any of the previous threads but
	the Header object has a setAttribute() method which can be used to
	set attribute values directly.

	Dan

-----Original Message-----
From: Fred Meredith [mailto:fmeredith@nc.rr.com]
Sent: Tuesday, August 06, 2002 4:53 PM
To: soap-user@xml.apache.org
Subject: Re: How to add attributes in the SOAP HEADER?


In my application, we're using a message based SOAP service using SOAP
Headers.  We made it work by declaring XML tags like <namespace:tagname
xmlns:namespace="namespace uri">tagvalue</tagname>

With this tag (or tags) as a String, you can do this:
    javax.xml.parsers.DocumentBuilder xdb =
XMLParserUtils.getXMLDocBuilder();
    Document doc = xdb.parse(new InputSource(new
java.io.StringReader(tagXML)));

    Header msgHeader = Header.unmarshall(doc.getDocumentElement(), new
org.apache.soap.rpc.SOAPContext());


and then this header can be set in your Message object, using setHeader().

Hope this helps,



>
> Hello,
>
> I am using Apache SOAP 2.3.1
>
> I have searched the doc and the mailing list archives
> and I did not find any working code.
> (similar questions have already been posted on SOAP-DEV)
>
> Any ideas?
>
> Thank you for your help.
>
> Olivier Reisacher
>
>
>
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>



--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>



--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>


RE: How to add attributes in the SOAP HEADER?

Posted by DAniel Allen <da...@nist.gov>.
	Excuse me if i missed something in any of the previous threads but
	the Header object has a setAttribute() method which can be used to
	set attribute values directly.

	Dan

-----Original Message-----
From: Fred Meredith [mailto:fmeredith@nc.rr.com]
Sent: Tuesday, August 06, 2002 4:53 PM
To: soap-user@xml.apache.org
Subject: Re: How to add attributes in the SOAP HEADER?


In my application, we're using a message based SOAP service using SOAP
Headers.  We made it work by declaring XML tags like <namespace:tagname
xmlns:namespace="namespace uri">tagvalue</tagname>

With this tag (or tags) as a String, you can do this:
    javax.xml.parsers.DocumentBuilder xdb =
XMLParserUtils.getXMLDocBuilder();
    Document doc = xdb.parse(new InputSource(new
java.io.StringReader(tagXML)));

    Header msgHeader = Header.unmarshall(doc.getDocumentElement(), new
org.apache.soap.rpc.SOAPContext());


and then this header can be set in your Message object, using setHeader().

Hope this helps,



>
> Hello,
>
> I am using Apache SOAP 2.3.1
>
> I have searched the doc and the mailing list archives
> and I did not find any working code.
> (similar questions have already been posted on SOAP-DEV)
>
> Any ideas?
>
> Thank you for your help.
>
> Olivier Reisacher
>
>
>
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>



--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>


RE: How to add attributes in the SOAP HEADER?

Posted by DAniel Allen <da...@nist.gov>.
	Excuse me if i missed something in any of the previous threads but
	the Header object has a setAttribute() method which can be used to
	set attribute values directly.

	Dan

-----Original Message-----
From: Fred Meredith [mailto:fmeredith@nc.rr.com]
Sent: Tuesday, August 06, 2002 4:53 PM
To: soap-user@xml.apache.org
Subject: Re: How to add attributes in the SOAP HEADER?


In my application, we're using a message based SOAP service using SOAP
Headers.  We made it work by declaring XML tags like <namespace:tagname
xmlns:namespace="namespace uri">tagvalue</tagname>

With this tag (or tags) as a String, you can do this:
    javax.xml.parsers.DocumentBuilder xdb =
XMLParserUtils.getXMLDocBuilder();
    Document doc = xdb.parse(new InputSource(new
java.io.StringReader(tagXML)));

    Header msgHeader = Header.unmarshall(doc.getDocumentElement(), new
org.apache.soap.rpc.SOAPContext());


and then this header can be set in your Message object, using setHeader().

Hope this helps,



>
> Hello,
>
> I am using Apache SOAP 2.3.1
>
> I have searched the doc and the mailing list archives
> and I did not find any working code.
> (similar questions have already been posted on SOAP-DEV)
>
> Any ideas?
>
> Thank you for your help.
>
> Olivier Reisacher
>
>
>
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>



Re: How to add attributes in the SOAP HEADER?

Posted by Fred Meredith <fm...@nc.rr.com>.
In my application, we're using a message based SOAP service using SOAP
Headers.  We made it work by declaring XML tags like <namespace:tagname
xmlns:namespace="namespace uri">tagvalue</tagname>

With this tag (or tags) as a String, you can do this:
    javax.xml.parsers.DocumentBuilder xdb =
XMLParserUtils.getXMLDocBuilder();
    Document doc = xdb.parse(new InputSource(new
java.io.StringReader(tagXML)));

    Header msgHeader = Header.unmarshall(doc.getDocumentElement(), new
org.apache.soap.rpc.SOAPContext());


and then this header can be set in your Message object, using setHeader().

Hope this helps,



>
> Hello,
>
> I am using Apache SOAP 2.3.1
>
> I have searched the doc and the mailing list archives
> and I did not find any working code.
> (similar questions have already been posted on SOAP-DEV)
>
> Any ideas?
>
> Thank you for your help.
>
> Olivier Reisacher
>
>
>
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>


Re: How to add attributes in the SOAP HEADER?

Posted by Fred Meredith <fm...@nc.rr.com>.
In my application, we're using a message based SOAP service using SOAP
Headers.  We made it work by declaring XML tags like <namespace:tagname
xmlns:namespace="namespace uri">tagvalue</tagname>

With this tag (or tags) as a String, you can do this:
    javax.xml.parsers.DocumentBuilder xdb =
XMLParserUtils.getXMLDocBuilder();
    Document doc = xdb.parse(new InputSource(new
java.io.StringReader(tagXML)));

    Header msgHeader = Header.unmarshall(doc.getDocumentElement(), new
org.apache.soap.rpc.SOAPContext());


and then this header can be set in your Message object, using setHeader().

Hope this helps,



>
> Hello,
>
> I am using Apache SOAP 2.3.1
>
> I have searched the doc and the mailing list archives
> and I did not find any working code.
> (similar questions have already been posted on SOAP-DEV)
>
> Any ideas?
>
> Thank you for your help.
>
> Olivier Reisacher
>
>
>
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>


Re: How to add attributes in the SOAP HEADER?

Posted by lr...@freevoice.org.
Sorry, spoke too soon (then hit the "send" instead of "cancel" on my mail
client.  I know how to add an attribute to the SOAP Envelope, but I don't
think that's what you want.

	-Larry


On Tue, 6 Aug 2002 lreeder@freevoice.org wrote:

> If you're using message-based SOAP (kind of sounds like you are if you
> want to
>
>
>
> On Tue, 6 Aug 2002, Olivier Reisacher wrote:
>
> >
> > Hello,
> >
> > I am using Apache SOAP 2.3.1
> >
> > I have searched the doc and the mailing list archives
> > and I did not find any working code.
> > (similar questions have already been posted on SOAP-DEV)
> >
> > Any ideas?
> >
> > Thank you for your help.
> >
> > 	Olivier Reisacher
> >
> >
> >
> > --
> > To unsubscribe, e-mail:   <ma...@xml.apache.org>
> > For additional commands, e-mail: <ma...@xml.apache.org>
> >
>
>
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>


Re: How to add attributes in the SOAP HEADER?

Posted by lr...@freevoice.org.
Sorry, spoke too soon (then hit the "send" instead of "cancel" on my mail
client.  I know how to add an attribute to the SOAP Envelope, but I don't
think that's what you want.

	-Larry


On Tue, 6 Aug 2002 lreeder@freevoice.org wrote:

> If you're using message-based SOAP (kind of sounds like you are if you
> want to
>
>
>
> On Tue, 6 Aug 2002, Olivier Reisacher wrote:
>
> >
> > Hello,
> >
> > I am using Apache SOAP 2.3.1
> >
> > I have searched the doc and the mailing list archives
> > and I did not find any working code.
> > (similar questions have already been posted on SOAP-DEV)
> >
> > Any ideas?
> >
> > Thank you for your help.
> >
> > 	Olivier Reisacher
> >
> >
> >
> > --
> > To unsubscribe, e-mail:   <ma...@xml.apache.org>
> > For additional commands, e-mail: <ma...@xml.apache.org>
> >
>
>
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>


Re: How to add attributes in the SOAP HEADER?

Posted by lr...@freevoice.org.
If you're using message-based SOAP (kind of sounds like you are if you
want to



On Tue, 6 Aug 2002, Olivier Reisacher wrote:

>
> Hello,
>
> I am using Apache SOAP 2.3.1
>
> I have searched the doc and the mailing list archives
> and I did not find any working code.
> (similar questions have already been posted on SOAP-DEV)
>
> Any ideas?
>
> Thank you for your help.
>
> 	Olivier Reisacher
>
>
>
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>


Re: How to add attributes in the SOAP HEADER?

Posted by lr...@freevoice.org.
If you're using message-based SOAP (kind of sounds like you are if you
want to



On Tue, 6 Aug 2002, Olivier Reisacher wrote:

>
> Hello,
>
> I am using Apache SOAP 2.3.1
>
> I have searched the doc and the mailing list archives
> and I did not find any working code.
> (similar questions have already been posted on SOAP-DEV)
>
> Any ideas?
>
> Thank you for your help.
>
> 	Olivier Reisacher
>
>
>
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>