views:

51

answers:

0

Hi All,

Same question is asked previously in this forum. I am asking it again after referring all question in this forum.

Problem :- I am trying call call .NET Web service from Android device. I can call web service without parameter successfully; but when tried to pass parameter it shows null in server side log.

Technology/API used : -

-> KSOAP 2.0 for Android

-> .NET Framework 3.5 + WCF Web service

-> Web service type is document literal.

Point to be noted over here is same service working fine with normal .NET Web service.

Before I post my code here is my trying so far,

  1. As suggested in this forum, I have changed server side NAMESPACE to URI not URL. For i.e. - Previously it was http://tempurl.com and now i have changed it to uri:myService

  2. I am adding XML header in the request, even tried to by removing it. i.e - httpTransport.setXmlVersionTag("<?xml version=\"1.0\" encoding= \"UTF-8\"?>");

  3. I have enabled the Access data sources across domains IE option in server side/client side.

Code looks like below,

    request = new SoapObject(Util.NAMESPACE, method);
request.addProperty("name", value);
soapEnvelope = new SoapSerializationEnvelope(SoapSerializationEnvelope.VER11);
    httpTransport = new HttpTransportSE(Util.URL);
    soapEnvelope.dotNet = true;
    soapEnvelope.setOutputSoapObject(request);
    httpTransport.setXmlVersionTag("<?xml version=\"1.0\" encoding= \"UTF-8\"?>"); 
    httpTransport.call(SOAP_ACTION, soapEnvelope);

I have end up spending lots of time in this issue.

Help will be appreciated.