Re: Newbie merlin/http question (find out about SOAP)
Idris B Saliu <[email protected]> Sun, 17 Oct 2004 16:07:39 +0100
| Newsgroups | gmane.comp.jakarta.avalon.user |
|---|---|
| Message-ID | <[email protected]> |
Samuel,
Thanks for the info, I have no problem parsing the XML, I just would
like to know if the merlin container has an embedded servelet container
that my SMS server can do a HTTP POST request too.
--idris
On Oct 17, 2004, at 3:51 PM, Samuel Ferrer wrote:
>
> Is not a soap message. But it is very easy to use the SAXP api to
> parse the xml messages and retrieve data. Here is one example.
>
> Observe that the constructir only accept path, but you can add a new
> one accepting a StringReader as argument.
>
> then use: builder.parse(new InputSource(your string reader)).
>
> if you have more questions just ask.
>
>
> Example----------------------------------------------------------------
> -------------------------------------------------
> package ferra.xml;
>
> //packages for parser
> import javax.xml.parsers.DocumentBuilder;
> import javax.xml.parsers.DocumentBuilderFactory;
> import org.w3c.dom.Document;
>
> //package for node lookup ... using XPath
> import org.apache.xpath.XPathAPI;
>
> import java.io.*;
>
>
> public class XMLObject {
> private Document doc = null;
>
> public XMLObject(String path){
> DocumentBuilderFactory factory =
> DocumentBuilderFactory.newInstance();
>
> try{
> DocumentBuilder builder = factory.newDocumentBuilder();
> doc = builder.parse(new File(path));
> }
> catch(Exception e){
> }
> }
>
> public XMLObject(Document doc){
> this.doc = doc;
> }
>
> public String getValue(String path){
> try{
> return
> XPathAPI.selectSingleNode(doc.getDocumentElement(),path).getNodeValue()
> ;
> }
> catch(Exception e){
> return null;
> }
> }
> }
>
> --------------------------------------------------------
>
> //Maquina
>
> _________________________________________________________________
> Express yourself instantly with MSN Messenger! Download today it's
> FREE! http://messenger.msn.com/
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>