> I am using KSOAP 2 2.6.1 to call .NET webservices but I am facing a
> problem with one of the call that receives a custom .NET Object.
> This is the envelope SOAP UI sends and it is working:
> <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>
> This is my code that is not working:
> 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);
> Basically the Webservice is receiving the command as null. Any idea why?
> Thank you very much for your time.
> Best Regards,