Hi All,
I have developed a client on BB using ksoap2.
I have tried using the MDS simulator along with the device simulator (as mentioned in some post), but whenever i send a request, i get the following Exception:
org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope (position:START_TAG <{http://www.w3.org/2003/05/soap-envelope}soap:Envelope>@1:205 in java.io.InputStreamReader@2bdcc2b0)
I dunno whats going wrong or how to go about it. Please help.
I am developing using the following components:
BB OS: 4.1.0
JDE: 4.1.0
ksoap2: lib\ksoap2-j2me-core-prev-2.1.2.jar
PS: I can access it through http demo application, but not through my web service. I am pasting my code below:
Code:
private String IPorHostname = "http://192.168.1.33";
private String path = "/xyzs/service.asmx";
public MXYZ_Main() {
SoapObject request = new SoapObject("http://tempuri.org/", "DealerOutstanding");
request.addProperty("dlr_code", "1177");
System.out.println(request.toString());
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.bodyOut = request;
envelope.dotNet = true;
HttpTransport ht = new HttpTransport(IPorHostname + path);
ht.debug = true;
try {
ht.call("", envelope);
SoapObject result = (SoapObject) envelope.getResponse();
System.out.println(result.toString());
String str = result.getProperty("DealerOutstandingResult").toString();
System.out.println("Soap: " + str);
} catch (XmlPullParserException ex) {
ex.printStackTrace();
} catch (IOException ex) {
ex.printStackTrace();
} catch (Exception ex) {
System.out.println("ex " + ex.toString());
}