Get the App
SLTechnology News&Howtos  ›  Development  › 

How to pass XML as a parameter in android ksoap2

Shulou Source: shulou.com Published: 2022-06-03 16:43:43 11月14日 Update

This article mainly explains "how to pass XML as a parameter in android ksoap2". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to pass XML as a parameter in android ksoap2.

Article catalogue

Treatment method

I need to send webservice in my android app, so I use ksop2 to send it, which is not very smooth during the test and does not work properly.

My web service request format is as follows

[string?] [string?] [string?] [string?]

I use ksoap2 in my android code as follows

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)

The ksop2 looks like this after processing the request

B5B2FDF87E848946red

Tags: Parameters content methods processing learning practical deeper code interest practicality practical easy to operate articles more friends formats directories websites processes channels Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn Shulou Information Apple Shulou Tech Info Redmi