public class FirstScreen extends Activity { /** Called when the activity is first created. */ private static final String SOAP_ACTION= "StockQuoteService"; private static final String URL = "http://www.restfulwebservices.net/wcf/StockQuoteService.svc?wsdl"; private static final String NAMESPACE = "http://www.restfulwebservices.net/ServiceContracts/2008/01"; private static final String METHOD_NAME = "GetStockQuote"; TextView tv; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); tv = (TextView)findViewById(R.id.textView1); SoapObject Request = new SoapObject(NAMESPACE,METHOD_NAME); Request.addProperty("", ""); SoapSerializationEnvelope soapEnvelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); soapEnvelope.dotNet = true; soapEnvelope.setOutputSoapObject(Request); AndroidHttpTransport aht = new AndroidHttpTransport(URL); try { aht.call(SOAP_ACTION, soapEnvelope); SoapPrimitive resultString = (SoapPrimitive)soapEnvelope.getResponse(); tv.setText("Status :" + resultString ); } catch(Exception e) { e.printStackTrace(); } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)