Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The simple and basic idea is to establish a connection to the Web Service URL and post the XML data to that URL. The code below assumes the Web Service URL is <a href="http://www.example.com/example.asmx" rel="nofollow noreferrer">http://www.example.com/example.asmx</a> and the method you want to call is WebServiceMethod1 which accepts one string parameter. The return string is the response from the Web Service, you have to parse the XML to get the data.</p> <pre><code>public static String callWebServiceMethod(String email){ HttpClient httpClient = new DefaultHttpClient(); HttpPost httpPost = new HttpPost("http://www.example.com/example.asmx"); String webServiceXml = ""; String response = ""; try { webServiceXml += "&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;"; webServiceXml += "&lt;soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\"&gt;"; webServiceXml += "&lt;soap:Header&gt;"; webServiceXml += "&lt;AuthHeader xmlns=\"http://www.example.com/\"&gt;"; webServiceXml += "&lt;/AuthHeader&gt;"; webServiceXml += "&lt;/soap:Header&gt;"; webServiceXml += "&lt;soap:Body&gt;"; webServiceXml += "&lt;WebServiceMethod1 xmlns=\"http://www.example.com/\"&gt;"; webServiceXml += "&lt;emailId&gt;" + email + "&lt;/emailId&gt;"; webServiceXml += "&lt;/WebServiceMethod1&gt;"; webServiceXml += "&lt;/soap:Body&gt;"; webServiceXml += "&lt;/soap:Envelope&gt;"; httpPost.setHeader("content-type","text/xml; charset=utf-8"); httpPost.setHeader("SOAPAction","http://www.example.com/WebServiceMethod1"); httpPost.setEntity(new StringEntity(webServiceXml)); HttpResponse httpResponse = httpClient.execute(httpPost); response = EntityUtils.toString(httpResponse.getEntity()); } catch(Exception ex) { Log.i("error", ex.getMessage()); } return response; </code></pre> <p>}</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload