Hi Guys,
Ksoap does not implement serialization itself while sending byte array using ksoap call.
When we are using web services in android we need to implement serialization before we send the byte array otherwise we are getting error can not serialize byte array.
private static final String NAMESPACE = ".xsd url taken from the web service URL";
private static final String URL = "web service URL";
private static final String SOAP_ACTION = "Action port typr";
private static final String METHOD_NAME = "Method name";
private static final String URL = "web service URL";
private static final String SOAP_ACTION = "Action port typr";
private static final String METHOD_NAME = "Method name";
the above parameter can be taken from the users web service (?WSDL) url
SoapObject request = new SoapObject(NAMESPACE, AUTH_METHOD);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
SoapEnvelope.VER11);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
SoapEnvelope.VER11);
new MarshalBase64().register(envelope); //serialization
envelope.encodingStyle = SoapEnvelope.ENC;
request.addProperty("body", str);
request.addProperty("image", imagebyte);
envelope.setOutputSoapObject(request);
HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
try{
androidHttpTransport.call(SOAP_ACTION, envelope);
SoapObject resultsRequestSOAP = (SoapObject) envelope.bodyIn;
String str=resultsRequestSOAP.toString();
SoapObject resultsRequestSOAP = (SoapObject) envelope.bodyIn;
String str=resultsRequestSOAP.toString();
}catch(Exception e)
{
}