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 Vincent Jong <vi...@gmail.com> on 2004/12/29 01:34:14 UTC

How do I manipulate the array of type Element in the MessageService example in Axis 1.2RC2?

I'm using Axis version 1.2RC2 (binary package) and have web services
working on Tomcat 4.1.  I've successfully deployed the pre-built
MessageService sample and have the SOAPMonitor monitoring that
service.  I'm trying to right now figure out how to modify the elems
parameter which is an array of type Element.  Basically, I'm just
trying to do a simple thing of setting an element's name (like
elems[0] ) to something like "foo" using the inherited setName method.
 I've tried using the syntax of:

elems[0].setName("foo");

but I keep getting compile errors.  What would be the correct way to
manipulate an element of an array of type Element?

The service I'm trying to modify is in $AXIS_HOME/samples/message. 
Does anyone know if it would be okay to post the source code in case
it is requested?

Thank you for your consideration in this matter.

Vincent Jong

Re: How do I manipulate the array of type Element in the MessageService example in Axis 1.2RC2?

Posted by Vincent Jong <vi...@gmail.com>.
Yes, it does seem I've mistaken the 2 packages.  So far I've been able
to get basic things like tag name, the number of elements from that
array, elems, whether it has child nodes, and even changing an
attribute/value of the main Element (the array of type Element has a
count of 1).

Seeing as the SOAP request has child nodes (used
elems[index].hasChildNodes() ), how would I go about displaying these
child nodes so I can at a later time make changes to them?  I've been
looking at the java docs for org.w3c.dom.Element, org.w3c.dom.Node,
and org.w3c.dom.Nodelist and I can't make heads or tails of how to go
about using them.  Any help in this matter would be greatly
appreciated.

Thanks for your time in this matter,

Vincent J.


On Wed, 29 Dec 2004 22:41:41 +0900, Jongjin Choi <gu...@hotmail.com> wrote:
> The org.w3c.dom.Element , which is used in samples/message, has no method named 'setName'.
> I think you are confusing org.w3c.dom.Element with org.apache.axis.MessageElement.
> 
> What about using the other variation of message style service?
> 
> According to Axis user documentation, (http://ws.apache.org/axis/java/user-guide.html#PublishingServices)
> the four signature is possible.
> public Element [] method(Element [] bodies);
> 
> public SOAPBodyElement [] method (SOAPBodyElement [] bodies);
> 
> public Document method(Document body);
> 
> public void method(SOAPEnvelope req, SOAPEnvelope resp);
> 
> Also note that the SOAPBodyElement and SOAPEnvelope's package is org.apache.axis.message NOT javax.xml.soap.
> 
> /Jongjin.
> 
> ----- Original Message -----
> From: "Vincent Jong" <vi...@gmail.com>
> To: <ax...@ws.apache.org>
> Sent: Wednesday, December 29, 2004 9:34 AM
> Subject: How do I manipulate the array of type Element in the MessageService example in Axis 1.2RC2?
> 
> > I'm using Axis version 1.2RC2 (binary package) and have web services
> > working on Tomcat 4.1.  I've successfully deployed the pre-built
> > MessageService sample and have the SOAPMonitor monitoring that
> > service.  I'm trying to right now figure out how to modify the elems
> > parameter which is an array of type Element.  Basically, I'm just
> > trying to do a simple thing of setting an element's name (like
> > elems[0] ) to something like "foo" using the inherited setName method.
> > I've tried using the syntax of:
> >
> > elems[0].setName("foo");
> >
> > but I keep getting compile errors.  What would be the correct way to
> > manipulate an element of an array of type Element?
> >
> > The service I'm trying to modify is in $AXIS_HOME/samples/message.
> > Does anyone know if it would be okay to post the source code in case
> > it is requested?
> >
> > Thank you for your consideration in this matter.
> >
> > Vincent Jong
> >

Re: How do I manipulate the array of type Element in the MessageService example in Axis 1.2RC2?

Posted by Jongjin Choi <gu...@hotmail.com>.
The org.w3c.dom.Element , which is used in samples/message, has no method named 'setName'. 
I think you are confusing org.w3c.dom.Element with org.apache.axis.MessageElement.

What about using the other variation of message style service?

According to Axis user documentation, (http://ws.apache.org/axis/java/user-guide.html#PublishingServices)
the four signature is possible.
public Element [] method(Element [] bodies); 

public SOAPBodyElement [] method (SOAPBodyElement [] bodies); 

public Document method(Document body); 

public void method(SOAPEnvelope req, SOAPEnvelope resp); 


Also note that the SOAPBodyElement and SOAPEnvelope's package is org.apache.axis.message NOT javax.xml.soap.

/Jongjin.
 
----- Original Message ----- 
From: "Vincent Jong" <vi...@gmail.com>
To: <ax...@ws.apache.org>
Sent: Wednesday, December 29, 2004 9:34 AM
Subject: How do I manipulate the array of type Element in the MessageService example in Axis 1.2RC2?


> I'm using Axis version 1.2RC2 (binary package) and have web services
> working on Tomcat 4.1.  I've successfully deployed the pre-built
> MessageService sample and have the SOAPMonitor monitoring that
> service.  I'm trying to right now figure out how to modify the elems
> parameter which is an array of type Element.  Basically, I'm just
> trying to do a simple thing of setting an element's name (like
> elems[0] ) to something like "foo" using the inherited setName method.
> I've tried using the syntax of:
> 
> elems[0].setName("foo");
> 
> but I keep getting compile errors.  What would be the correct way to
> manipulate an element of an array of type Element?
> 
> The service I'm trying to modify is in $AXIS_HOME/samples/message. 
> Does anyone know if it would be okay to post the source code in case
> it is requested?
> 
> Thank you for your consideration in this matter.
> 
> Vincent Jong
>