Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Contributor
Posts: 2
Registered: ‎07-29-2011
My Device: 5900
My Carrier: Airtel

Calling Soap webservice from blackberry java application

[ Edited ]

I am new to blackberry , iam just trying to call  a Web service that do some operations on SAP CRM , ,but iam getting this exception:
org.xmlpull.v1.XmlPullParserException: unexpected type (position:END_DOCUMENT null@1:0 in  java.io.InputStreamReader@c599f9fd) 

Here is the code...

       SoapObject rpc = new SoapObject(serviceNamespace,"zws_incoming_email");

       rpc.addProperty("username","sreenu");

       rpc.addProperty("Password","ravi");

       SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
       envelope.bodyOut = rpc;

       envelope.dotNet = true;
       envelope.encodingStyle = SoapSerializationEnvelope.ENC;
       envelope.env = "http://schemas.xmlsoap.org/soap/envelope/";
       HttpTransport ht = new HttpTransport(serviceUrl);
     //s  ht.requestDump=msg;
       ht.debug = true;
       String request="";
       ht.setXmlVersionTag("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"  );
       String response=ht.responseDump;
            try
                { 
                System.out.print("2222222");
                ht.call(soapAction,envelope);
                String result = (envelope.getResponse()).toString();
                System.out.println("in try block"+result);
                System.out.println("Request"+request);
                System.out.println("Response"+response);
                System.out.println("Result......"+result); 
                 }       
            catch(org.xmlpull.v1.XmlPullParserException ex2){
                String msg2 = ex2.toString();
                  request=ht.requestDump;
                    response=ht.responseDump;
                 System.out.println("Exception...... "+msg2);
                  System.out.println("request...... "+request);
                  System.out.println("response...... "+response);
                     }
                               
              catch(Exception ex)
               {
            String msg1 = ex.toString();
               System.out.println(".......... catch block"+msg1);
              }    
    }


Exception raises after ht.call() method,Please help me..............