Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public String[] doSOAPRequest(){
- String[] results = null;
- String NAMESPACE = "http://www.wizards.com/";
- String METHOD_NAME = "KeywordSearch";
- String SOAP_ACTION = "KeywordSearch";
- String URL = "http://www.wizards.com/dndinsider/compendium/compendiumsearch.asmx";
- SoapObject Request = new SoapObject(NAMESPACE, METHOD_NAME);
- PropertyInfo pi = new PropertyInfo();
- pi.setName("Operand1");
- pi.setValue(2);
- pi.setType(int.class);
- Request.addProperty(pi);
- PropertyInfo pi2 = new PropertyInfo();
- pi2.setName("Operand2");
- pi2.setValue(5);
- pi2.setType(int.class);
- Request.addProperty(pi2);
- SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
- envelope.dotNet = true;
- envelope.setOutputSoapObject(Request);
- AndroidHttpTransport androidHttpTransport = new AndroidHttpTransport(URL);
- try
- {
- androidHttpTransport.call(SOAP_ACTION, envelope);
- SoapObject response = (SoapObject)envelope.getResponse();
- Object soapresult = (Object)response;
- results = (String[]) soapresult;
- Log.d("worked out","worked");
- }
- catch(Exception e)
- {
- e.printStackTrace();
- Log.d(e.toString(),"debug soap");
- }
- return results;
- }
Advertisement
Add Comment
Please, Sign In to add comment