Hi,
I need to send this soap to a .NET WCF webservice:
<soapenv:Envelope xmlns:soapenv="
http://schemas.xmlsoap.org/soap/
envelope/" xmlns:tem="
http://tempuri.org/" xmlns:qui="http://
schemas.datacontract.org/2004/07/QUiiQSharedLibrary">
<soapenv:Header/>
<soapenv:Body>
<tem:SetCommand>
<!--Optional:-->
<tem:sessionToken>86f04e4c</tem:sessionToken>
<!--Optional:-->
<tem:command>
<!--Optional:-->
<qui:CommandType>IDENTIFIER_MEMBER_VALUE</qui:CommandType>
<!--Optional:-->
<qui:Identifier>4</qui:Identifier>
<!--Optional:-->
<qui:MemberStates>
<!--Zero or more repetitions:-->
<qui:QUiiQMemberState>
<!--Optional:-->
<qui:Member>control</qui:Member>
<!--Optional:-->
<qui:Value>0</qui:Value>
</qui:QUiiQMemberState>
</qui:MemberStates>
</tem:command>
</tem:SetCommand>
</soapenv:Body>
</soapenv:Envelope>
I am using the following code:
Log.v("WSDL", "SOAP: SetCommand()");
String METHOD_NAME = "SetCommand";
String SOAP_ACTION = NAMESPACE + "IHomeControl_Service/" +
METHOD_NAME;
SoapSerializationEnvelope sse = new SoapSerializationEnvelope(
SoapEnvelope.VER11);
sse.dotNet = true;
SoapObject obj = new SoapObject(NAMESPACE, METHOD_NAME);
obj.addProperty("sessionToken", session_token);
SoapObject command = new SoapObject(NAMESPACE, "command");
command.addProperty("CommandType", cmd.get_commandType().toString()
.toUpperCase());
command.addProperty("Identifier", cmd.get_identifier());
SoapObject member_states = new SoapObject(NAMESPACE,
"MemberStates");
List<QUiiQMemberState> member_state = cmd.get_memberStates();
for (int i = 0; i < member_state.size(); i++) {
SoapObject member = new SoapObject(NAMESPACE, "QUiiQMemberState");
member.addProperty("Member", member_state.get(i).get_member());
member.addProperty("Value", member_state.get(i).get_value());
member_states.addSoapObject(member);
}
command.addSoapObject(member_states);
obj.addSoapObject(command);
sse.setOutputSoapObject(obj);
// sse.bodyOut = obj;
HttpTransportSE ahttpTrans = new HttpTransportSE(URL);
ahttpTrans.call(SOAP_ACTION, sse);
But I keep getting wrong session ID ( I can guarantee that the session
ID is OK:) )
If I remove the command soap object, I get session token OK.
Can you please advice me on what am I doing wrong?
Thanks,
Rui