Created
December 23, 2014 20:59
-
-
Save emedinaa/514bee2f7e3ddc384478 to your computer and use it in GitHub Desktop.
Example WebServices
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public String loadInBackground() { | |
if(NetworkConnectivityUtils.hasNetworkConnectivity(connectivityManager)) | |
{ | |
MyEntity entity = new MyEntity(); | |
Gson gson = new Gson(); | |
String json = gson.toJson(entity); | |
request = new SoapObject(NAMESPACE, METHOD_NAME); | |
request.addProperty("pMethod", json); | |
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); | |
envelope.dotNet=true; | |
envelope.setOutputSoapObject(request); | |
HttpTransportSE transporte = new HttpTransportSE(URL,MyConstant.CONNECTION_TIMED_OUT); | |
try { | |
transporte.call(SOAP_ACTION, envelope); | |
resultsRequestSOAP = (SoapPrimitive)envelope.getResponse(); | |
String strJSON = resultsRequestSOAP.toString(); | |
result =strJSON; | |
}catch(Throwable e) | |
{ | |
//FLog.v(" MyLoader error", e); | |
e.printStackTrace(); | |
return null; | |
} | |
}else | |
{ | |
result=null; | |
} | |
isLoading = false; | |
return result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment