Reputation: 2382
The Soap service
expects the following operation:
<wsdl:operation name="UploadFile">
<soap:operation soapAction="http://abcdotcom/IDocUpload/UploadFile" style="document"/>
<wsdl:input name="FileInfo">
<soap:header message="tns:FileInfo_Headers" part="Name" use="literal"/>
<soap:header message="tns:FileInfo_Headers" part="Length" use="literal"/>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="DownloadRequest">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
I am using ksoap2 library
. I am not able to figure out how to send data to the service?
I am trying with
request.addProperty("FileInfo", "123");
but its just giving me null
response. I am expecting an error
at least. Please help.
Upvotes: 2
Views: 119
Reputation: 1221
Sample soap request in android (method:FetchUserDetails)
SoapObject request = new SoapObject("http://tempuri.org/", "FetchUserDetails");
request.addProperty("key", value);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.setOutputSoapObject(request);
envelope.dotNet = true;
try {
HttpTransportSE androidHttpTransport = new HttpTransportSE(ServiceURL);
androidHttpTransport.call("http://tempuri.org/FetchUserDetails", envelope);
SoapObject response = (SoapObject) envelope.getResponse();
int count = response.getPropertyCount();
if (count > 0) {
//handel the response
SoapObject results = (SoapObject) response.getProperty(i);
}
}catch (Exception e) {
Log.e("service", e.getMessage());
}
Upvotes: 4