1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
private static final String SOAP_ACTION = "http://mondomaine.fr/maFonction";
private static final String METHOD_NAME = "maFonction";
private static final String NAMESPACE = "http://mondomaine.fr/";
private static final String URL = "http://mondomaine.fr/services/mesServices.asmx";
private int maFonction()
{
int week = 30;
try
{
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
Log.d("Path", "1");
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet = true;
envelope.setOutputSoapObject(request);
Log.d("Path", "2");
HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
androidHttpTransport.debug = true;
Log.d("Path", "3");
androidHttpTransport.call(SOAP_ACTION, envelope);
Log.d("Path", "4");
SoapObject result = ((SoapObject) envelope.getResponse());
week = Integer.parseInt(result.getProperty(0).toString());
Log.d("Path", "5");
}
catch (Exception e)
{
Log.e("Error", e.toString());
}
return week;
} |
Partager