Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I have done a fair bit of research before and ksoap2 has the abilities to do data transfers with webservice urls and I believe that it has other http functionalities which you could use.</p> <p><a href="http://ksoap2.sourceforge.net/" rel="nofollow">http://ksoap2.sourceforge.net/</a></p> <p>download ksoap2 and import to your project and create you service access layer as such:</p> <pre><code>import java.util.ArrayList; import java.util.List; import org.ksoap2.serialization.PropertyInfo; import org.ksoap2.serialization.SoapObject; import org.ksoap2.serialization.SoapPrimitive; import org.ksoap2.serialization.SoapSerializationEnvelope; import org.ksoap2.transport.HttpTransportSE; import org.ksoap2.SoapEnvelope; public class ServiceAccess { private static String Namespace; private static String MethodName; private static String URL; private SoapSerializationEnvelope Envelope; private SoapObject SoapRequest; private SoapPrimitive Response; private List&lt;PropertyInfo&gt; methodParamList; public ServiceAccess(String webserviceUrl, String methodName) throws Exception { setUrl(webserviceUrl); setMethodName(methodName); setNamespace("http://tempuri.org/"); SoapRequest = new SoapObject(this.getNamespace(), this.getMethodName()); methodParamList = new ArrayList&lt;PropertyInfo&gt;(); } protected String getUrl() { return URL; } protected void setUrl(String url) { URL = url; } protected String getMethodName() { return MethodName; } protected void setMethodName(String methodName) { MethodName = methodName; } protected String getNamespace() { return Namespace; } protected void setNamespace(String namespace) { Namespace = namespace; } protected String SoapAction() { String SOAP_ACTION = this.getNamespace() + this.getMethodName(); return SOAP_ACTION; } protected void CreateSoapRequest() throws Exception { try { if(methodParamList.size()&gt;0){ for(PropertyInfo propInfo : methodParamList) { SoapRequest.addProperty(propInfo.getName(), propInfo.getValue()); } } }catch(Exception ex){ throw ex; } } public &lt;T&gt; void addMethodParameters(String paramName, T val) { PropertyInfo prop = new PropertyInfo(); prop.setName(paramName); prop.setValue(val); prop.setType(val.getClass()); methodParamList.add(prop); } protected SoapSerializationEnvelope createEnvelope() throws Exception { this.CreateSoapRequest(); try{ Envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); Envelope.dotNet = true; Envelope.setOutputSoapObject(SoapRequest); }catch(Exception ex){ throw ex; } return Envelope; } public String getResponse() throws Exception { try{ this.createEnvelope(); HttpTransportSE androidHttpTransport = new HttpTransportSE(URL); androidHttpTransport.call(this.SoapAction(), Envelope); Response = (SoapPrimitive) Envelope.getResponse(); }catch(Exception ex){ throw ex; } return Response.toString(); } } </code></pre> <p>You can tweak around with it to use various urls of web pages instead of webservice urls.</p>
    singulars
    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. This table or related slice is empty.
    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