Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11571

Calling sharepoint custom webservices from android using Ksoap2

$
0
0

I'm trying to build an android app to access SharePoint online using the webservices

String SOAP_ACTION = "http://tempuri.org/GetAvailableLeaves";
         String OPERATION_NAME = "GetAvailableLeaves";

         String WSDL_TARGET_NAMESPACE = "http://tempuri.org/";
         String SOAP_ADDRESS="http://sp:8002/_layouts/sharepointwebservice/sharepointtestservice.asmx";
         request = new SoapObject(WSDL_TARGET_NAMESPACE,OPERATION_NAME);
         
         envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
        envelope.dotNet = true;
        envelope.implicitTypes=true;
     
        envelope.setOutputSoapObject(request);
     
        httpTransport = new HttpTransportSE(SOAP_ADDRESS);
        
        String authentication = android.util.Base64.encodeToString("username:#password".getBytes(), android.util.Base64.NO_WRAP);
        List<HeaderProperty> headerList = new ArrayList<HeaderProperty>();
        headerList.add(new HeaderProperty("Authorization", "Basic " + authentication));
       
                
        
        PropertyInfo user = new PropertyInfo();
        user.type = PropertyInfo.STRING_CLASS;
        user.setName("empid");
        user.setValue(empid.toString());
        request.addProperty(user);
        
       
        
       
        
         Object response;
         try{
             
            // httpTransport.call(SOAP_ACTION, envelope);
             httpTransport.call(SOAP_ACTION, envelope, headerList);
             String requestDumpString = httpTransport.requestDump;
             System.out.println(requestDumpString);
              response = envelope.getResponse();
           
              return response.toString();
        
             }
        
             catch (Exception exception)
        
              {
        
             
                 return "2";
              }
             

The following error occured When the HTTPTransportSE is called: 

org.xmlpull.v1.XmlPullParserException: unexpected type ( null@1:0 in java.io.InputStreamReader)

Please advise how to solve this, and if there is a good documentation that descrips the connection between sharepoint online and Mobile Platforms (Android, iOS) that would be appreciated.


Viewing all articles
Browse latest Browse all 11571

Trending Articles