View Single Post
Old 04-17-2008, 12:36 AM   #1 (permalink)
mark.ramos222
New Member
 
Join Date: Apr 2008
Model: 8800
PIN: N/A
Carrier: SMART
Posts: 1
Post Thanks: 0
Thanked 0 Times in 0 Posts
Exclamation Problem with ksoap2

Please Login to Remove!

I am trying to use ksoap to connect to SugarCRM and i had the following code:

Code:
  
try {
HttpTransport httpt = new HttpTransport("http://localhost/sugarroot/soap.php");

            SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);

            SoapObject test = new SoapObject("http://www.sugarcrm.com/sugarcrm", "test");
            test.addProperty("string", "Hello");

            envelope.setOutputSoapObject(test);
          
            httpt.call("http://localhost/sugarroot/soap.php/test", envelope);
            SoapObject body = (SoapObject) envelope.getResponse();
            System.out.println("Property Count: " + body.getPropertyCount());
            System.out.println(body.getProperty("string"));
            System.out.println("Result: " + envelope.getResponse());
        } catch (IOException ex) {
            System.err.println("Error: " + ex.getClass() + " | " + ex.getMessage());
        } catch (XmlPullParserException ex) {
            System.err.println("Error: " + ex.getClass() + " | " + ex.getMessage());
        }
the goal is just to send a string and the SugarCRM will echo it back.. it is Step 0 in the Overview of SugarCRM's API. but i don't know the problem with my code.. so please help.. i had the following error upon executing the line on the httpt.call() method..
class org.xmlpull.v1.XmlPullParserException | unexpected type (position:TEXT Not authorized t...@1:37 in java.io.InputStreamReader@6a6089f4)

I hope to get a response on this.
Thank you!

Last edited by mark.ramos222 : 04-17-2008 at 01:11 AM. Reason: forgot to remove the wsdl
Offline   Reply With Quote