0

I am having a problem to get a respond from my webservice. I have something like this:

<AuthenticateUser xmlns="http://whatever">
  <request>
    <Username>string</Username>
    <Password>string</Password>
    <Partner>string</Partner>
  </request>
 </AuthenticateUser>

I don't know how to add those tree parameters to object<request>

Anybody can help?

1
  • I am also interested in the answer, while I am also finding a way to do that. Commented Feb 3, 2011 at 12:44

1 Answer 1

3
private static final String SOAP_ACTION = "http://whatever/AuthenticateUser";
private static final String METHOD_NAME = "AuthenticateUser";
private static final String NAMESPACE = "http://whatever";
private static final String URL = "www.blablabla.com/test?WSDL";

SoapObject authenticateUser = new SoapObject(NAMESPACE, METHOD_NAME);
SoapObject request = new SoapObject(NAMESPACE, "request");
request.addProperty("Username","VALUE");
request.addProperty("Password","VALUE");
request.addProperty("Partner","VALUE");
authenticateUser.addSoapObject(request);

I hope that helps!

Sign up to request clarification or add additional context in comments.

5 Comments

SoapFault - faultcode: 'soap:Client' faultstring: 'Server was unable to read request. ---> There is an error in XML document (1, 367). ---> The specified type was not recognized: name=':' return this !!
The problem is i need to add another SoapObject not just `<request>' so i added two soap object like you did
authenticateUser.addSoapObject(request); and authenticateUser.addSoapObject(request2); but doesnt work
@Amalo you should open a new question because I answered this 6 year ago, things change between 2011 and now.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.