Can't send property to Service.svc with Ksoap2

172
February 15, 2018, at 11:54 PM

I am trying to use ksoap2-android library and I am not able to send any property correctly to the webservice.

The thing is I am reaching Login method but always receiving false, because the input is not as expected...

What I have tried so far:

1 - Using addProperty directly with my integer

SoapObject request = new SoapObject("http://tempuri.org/", "Login");
request.addProperty("number", l2345);

2 - Creating an object of a class I have created to test. This class is called Login and has just one variable called number

SoapObject request = new SoapObject("http://tempuri.org/", "Login");
Login log = new Login();
log.setNumber(12345);
request.addProperty("number", log);//number || input

3 - Creating a PropertyInfo object to add it to the request

SoapObject request = new SoapObject("http://tempuri.org/", "Login");
PropertyInfo propInfo = new PropertyInfo();
propInfo.setName("number");
propInfo.setValue(12345);
propInfo.setType(PropertyInfo.INTEGER_CLASS);
request.addProperty(propInfo);

4 - Creating a SoapObject and adding it to the SoapObject request...

SoapObject request = new SoapObject("http://tempuri.org/", "Login");
SoapObject req = new SoapObject();
req.addProperty("number", 12345);
request.addProperty("input",req);

Service.svc?wsdl (Login part...)

<wsdl:operation name="Login">
<soap:operation soapAction="http://tempuri.org/IMonitorService/Login" style="document"/>
<wsdl:input>
    <soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
    <soap:body use="literal"/>
</wsdl:output>

Login method Is a public method that returns a boolean and receive an integer.

bool Login(int number)

I have tried a lot of things, and searched for many examples with no luck... Server is receiving my requests but returning false because is not receiving any integer...

My requestDump is like:

<v:Envelope ...">
    <v:Header />
    <v:Body>
        <number i:type=":">123456789</number>
    </v:Body>
</v:Envelope>

How should my request look like? And how can I do it?

READ ALSO
How to capture photo and get image and thumbnail?

How to capture photo and get image and thumbnail?

I cannot believe that I've struggled with this simple problem for hours now, but I cannot get it to run properlyIn principle I want this functionality:

158
How do I get to scroll smoothly through a customized list view?

How do I get to scroll smoothly through a customized list view?

My custom List View just won't scroll smoothly enough and all the solutions that I looked up on this site were beyond my understandingPeople who are more than willing to explain from previous questions are equally welcome as those providing the solution

188
Playing .mp3 file gives AACPlayer &#39;Cannot start native decoder&#39; error

Playing .mp3 file gives AACPlayer 'Cannot start native decoder' error

Firstly, apologies, I'm not that advanced with Java

180