Android, KSoap2 and .NET Web Service w/ parameters = NULL

Put your problem here if it does not fit any of the other categories.

Android, KSoap2 and .NET Web Service w/ parameters = NULL

Postby Magua » Thu Nov 25, 2010 5:38 am

Apparently this is a known issue. I'm not sure entirely where the problem lies, or what needs to be adjusted, but for the life of me I cannot retrieve anything other than a NULL result to my SoapObject or SoapPrimitive from my .NET XML web service with parameters.

I've tried everything I've found on the net:
- Adding the .setXmlVersionTag = no change
- Using SoapObject instead of SoapPrimitive = no change
- Using SoapPrimitive instead of SoapObject = no change
- Using HttpTransportSE instead of AndroidHttppTransport = no change
- Using AndroidHttpTransport instead of HttpTransportSE = no change
- Setting .dotNet = true = no change
- Removing .dotNet assignment line = no change
- Removing the colon (entire HTTP:// prefix) from the web service = no change
- Using the PropertyInfo class instead of direct assignment = no change
- Using direct assignment instead of the PropertyInfo class = no change

I'm at a total loss and it's quite frustrating. I have total control of the web service (I wrote it) so minor changes, if helpful, I'm willing to attempt.

Currently my code as follows is this:

Code: Select all
    public void GetRecords()
    {
       SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
       request.addProperty("lastName", "b");
       request.addProperty("middleName", "");
       request.addProperty("firstName", "");
       request.addProperty("county", "");
       request.addProperty("beforeAfter", "");
       request.addProperty("birthYear", 0);
       request.addProperty("pageSize", 25);
       request.addProperty("pageNumber", 1);
              
       SoapSerializationEnvelope soapEnvelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
       
       soapEnvelope.dotNet = true;
       soapEnvelope.setOutputSoapObject(request);
       //AndroidHttpTransport aht = new AndroidHttpTransport(URL);
       HttpTransportSE aht = new HttpTransportSE(URL);
       
       try
       
       {
          aht.setXmlVersionTag("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
          aht.call(SOAP_ACTION, soapEnvelope);           
          
          //SoapObject result = (SoapObject)soapEnvelope.bodyIn;
          SoapObject result = (SoapObject)soapEnvelope.getResponse();
          //SoapPrimitive result = (SoapPrimitive) soapEnvelope.getResponse();
          //Object result = soapEnvelope.getResponse();
          
          Log.d("WS", String.valueOf(result));          
       }
       catch(Exception e)
       {
          e.printStackTrace();
       }       
    }


and my global variables:

Code: Select all
   private static final String SOAP_ACTION = "yoda/SearchByPerson";
   private static final String METHOD_NAME = "SearchByPerson";
   private static final String NAMESPACE = "yoda/";
   private static final String URL = "http://yoda/pa.asmx";


I know 'yoda' is translating correctly as my non-parameterized web serivce is working like a bloody champ. (Everything is identical save the 'request.addProperty' calls which are obviously the issue at hand.)

If it matters I'm writing this against a 1.6 target platform with KSoap2 2.5.2 and it behaves identically across all my different Android emulators.

So, can anyone throw me a bone here?

Thanks,

Magua
Magua
Freshman
Freshman
 
Posts: 2
Joined: Thu Nov 25, 2010 5:03 am

Top

Re: Android, KSoap2 and .NET Web Service w/ parameters = NUL

Postby tmartins » Tue Jan 22, 2013 1:04 am

Hello, I'm having the same problem? did you find any solution?
tmartins
Once Poster
Once Poster
 
Posts: 1
Joined: Tue Jan 22, 2013 1:02 am

Re: Android, KSoap2 and .NET Web Service w/ parameters = NUL

Postby Magua » Tue Jan 22, 2013 5:00 am

I did find the solution. See my own answer here: http://stackoverflow.com/questions/4290 ... ull-result

Hope that helps!
Magua
Freshman
Freshman
 
Posts: 2
Joined: Thu Nov 25, 2010 5:03 am

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: Google [Bot] and 20 guests