Passing XML (DataSet) as parameter to ksoap2 android

I am trying to send XML requst to webservice using ksop2 but it doesn't workig

my web service request format

<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
    <Body>
        <UpdateVehicleViaObj xmlns="http://tempuri.org/">
            <userHash>[string?]</userHash>
            <vehicleObject>
                <Colour xmlns="http://schemas.datacontract.org/2004/07/StockService">[string?]</Colour>
                <Comments xmlns="http://schemas.datacontract.org/2004/07/StockService">[string?]</Comments>
                <Condition xmlns="http://schemas.datacontract.org/2004/07/StockService">[string?]</Condition>                
            </vehicleObject>
        </UpdateVehicleViaObj>
    </Body>
</Envelope>

      

I am using ksoap2 to create a request like

SoapObject request = new SoapObject("Namespace", "methodname");
  request.addProperty(properyObject);

 SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);

        //SOAP is implemented in dotNet true/false.
        envelope.dotNet = true;
        MarshalDouble md = new MarshalDouble();
        //envelope.implicitTypes = true;
        envelope.implicitTypes = true;
        md.register(envelope);
        //Set request data into envelope and send request using HttpTransport
        envelope.setOutputSoapObject(request);
        HttpTransportSE androidHttpTransport = new HttpTransportSE(mInObj.getUrl(), networkTimeOut);

        androidHttpTransport.debug= true;
        androidHttpTransport.call(SoapAction, envelope,headerPropertyArrayList);

      

and ksop2 make it look like

<v:Envelope xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:d="http://www.w3.org/2001/XMLSchema" xmlns:c="http://schemas.xmlsoap.org/soap/encoding/" xmlns:v="http://schemas.xmlsoap.org/soap/envelope/"><v:Header /><v:Body><UpdateVehicleViaObj xmlns="http://tempuri.org/" id="o0" c:root="1"><userHash>B5B2FDF87E848946</userHash><vehicleObject>&lt;Colour&gt;red&lt;/Colour&gt;&lt;
&lt;Comments &gt;red&lt;/Comments &gt;&lt;&lt;Condition &gt;red&lt;/Condition &gt;&lt;</vehicleObject></UpdateVehicleViaObj></v:Body></v:Envelope>

      

please, help..

+3


source to share


1 answer


Look at the ksoap2 documentation

https://code.google.com/p/ksoap2-android/wiki/CodingTipsAndTricks#sending/receiving_array_of_complex_types_or_primitives



you can create a class that will implement the pluggable interface and add another property inside that class

+2


source







All Articles