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 "Bardman, Jody" <JB...@Liquent.com> on 2001/08/02 21:14:42 UTC

Working with Xerces

My SOAP client can build a simple request and send it to the SOAP server and then receive the response.
I can parse the data. 

Now comes the next step: 
1). Send a request
2). Receive the XML response.
3). Save the XML.
4). Parse some of the XML response.
5). Add new XML data to what was saved for a new request.
6). Send the new request.

So basically I want to get the response, add to it, and send it out again.

Here is how I was parsing the simple response:
  DOMParser parser = new DOMParser();  //Create a parser
  parser.parse(new InputSource(new StringReader(XMLPref)));  //Create the DOM
  Document doc = parser.getDocument();

I was hoping to add data by way of the doc/node classes.

How do I get the full XML out of the Document class so I can use it for a new request?

Thanks
Jody

RE: Working with Xerces

Posted by Gus Delgado <gu...@netquotient.com>.
Working with XercesDocument doc = parser.getDocument();

Element  e  = null;
NodeList nl = doc.getElementsByTagName("tagName");
e = (Element) nl.item(0);

e.normalize();
NodeList nl = e.getChildNodes();
Node textNode = nl.item(0);
String value = textNode.getNodeValue() ;

  -----Original Message-----
  From: Bardman, Jody [mailto:JBardman@Liquent.com]
  Sent: Thursday, August 02, 2001 2:15 PM
  To: soap-user@xml.apache.org
  Subject: Working with Xerces


  My SOAP client can build a simple request and send it to the SOAP server
and then receive the response.
  I can parse the data.

  Now comes the next step:
  1). Send a request
  2). Receive the XML response.
  3). Save the XML.
  4). Parse some of the XML response.
  5). Add new XML data to what was saved for a new request.
  6). Send the new request.

  So basically I want to get the response, add to it, and send it out again.

  Here is how I was parsing the simple response:
    DOMParser parser = new DOMParser();  //Create a parser
    parser.parse(new InputSource(new StringReader(XMLPref)));  //Create the
DOM
    Document doc = parser.getDocument();

  I was hoping to add data by way of the doc/node classes.

  How do I get the full XML out of the Document class so I can use it for a
new request?

  Thanks
  Jody


RE: Working with Xerces

Posted by Gus Delgado <gu...@netquotient.com>.
Working with XercesDocument doc = parser.getDocument();

Element  e  = null;
NodeList nl = doc.getElementsByTagName("tagName");
e = (Element) nl.item(0);

e.normalize();
NodeList nl = e.getChildNodes();
Node textNode = nl.item(0);
String value = textNode.getNodeValue() ;

  -----Original Message-----
  From: Bardman, Jody [mailto:JBardman@Liquent.com]
  Sent: Thursday, August 02, 2001 2:15 PM
  To: soap-user@xml.apache.org
  Subject: Working with Xerces


  My SOAP client can build a simple request and send it to the SOAP server
and then receive the response.
  I can parse the data.

  Now comes the next step:
  1). Send a request
  2). Receive the XML response.
  3). Save the XML.
  4). Parse some of the XML response.
  5). Add new XML data to what was saved for a new request.
  6). Send the new request.

  So basically I want to get the response, add to it, and send it out again.

  Here is how I was parsing the simple response:
    DOMParser parser = new DOMParser();  //Create a parser
    parser.parse(new InputSource(new StringReader(XMLPref)));  //Create the
DOM
    Document doc = parser.getDocument();

  I was hoping to add data by way of the doc/node classes.

  How do I get the full XML out of the Document class so I can use it for a
new request?

  Thanks
  Jody