Re: Parsing SOAP messages using kXML

Stefan Haustein <[email protected]> Wed, 16 Apr 2003 16:49:22 +0200
Newsgroups gmane.comp.java.enhydra.kxml
Message-ID <[email protected]>
> Now I am trying to parse it using the kXML APIs. It seems that when you 
> parse using kXML it accepts XML elements with only one word. that is it 
> will parse <SOAP-ENV> but not <SOAP-ENV: Envelope>

(...)

 > parser.read(Xml.START_TAG, "","SOAP-ENV:Envelope

Hi,

parser.read expects the type, the namespace and the tag name (null for
any). You may need to switch on namespace support. Please try

   String SOAP_ENV =           "http://schemas/xmlsoap.org/soap/envelope/";
   parser.read(Xml.START_TAG, SOAP_ENV, "Envelope");

you may want to take a look at the ksoap Envelope implementation which 
performs similar parsing steps.

> if(name.equals("PatientName xmlns=\"\" xsi:type=\"xsd:string\"")){

This will not work: the xml element name is only "PatientName", please 
use the attribute access methods to access the attributes (xsi:type).

Best,
Stefan