I created small program to parse envelope but I got the following error
Error in parsing: name expected (position:START_TAG <SOAP-ENV:Envelope
xmlns:SOAP-ENV='http://www.w3.org/2001/12/soap- envelope' xmlns:xsi='
http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='
http://www.w3.org/2001/XMLSchema'>@1:175 in java.io.stringrea...@c17164)
BUILD SUCCESSFUL (total time: 2 seconds)
How Can I solve it knowing that the code is:
package parsingsteps;
import java.io.*;
import org.ksoap2.SoapEnvelope;
import org.kxml2.io.KXmlParser;
import org.xmlpull.v1.XmlPullParserException;
/**
*
* @author fa00064
*/
public class ParsingSteps {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
try{
// String msg="<hello>World!</hello>";
String msg = "<SOAP-ENV:Envelope " + "xmlns:SOAP-ENV=\"
http://www.w3.org/2001/12/soap- envelope\" " + "xmlns:xsi=\"
http://www.w3.org/2001/XMLSchema-instance\<http://www.w3.org/2001/XMLSchema-instance/>"
"
+"xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\<http://www.w3.org/2001/XMLSchema/>"&
gt;" +
"<SOAP-ENV:Body>" +
"<result>" +
"<message xsi:type=\"xsd:string\">Hello World</message>" +
"</result>" +
"</SOAP-ENV:Body>" +
"</SOAP-ENV:Envelope>";
KXmlParser parser=new KXmlParser();
parser.setInput((Reader)new StringReader(msg));
SoapEnvelope soapenvelope= new SoapEnvelope(SoapEnvelope.VER12);
//soapenvelope.parse(parser);
soapenvelope.parseBody(parser);
}
catch (IOException e) {
System.out.println("Error reading URI: " + e.getMessage());
} catch (XmlPullParserException e) {
System.out.println("Error in parsing: " + e.getMessage());
}
// String result=parser.getName();
//System.out.println(result);
}
}
Can Any one solve the problem?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---