Note that there are some explanatory texts on larger screens.

plurals
  1. POError occured while calling web service
    primarykey
    data
    text
    <p>I am a newbie to Android web service calls. I am trying to develop an application that displays current temperature by making SOAP Web service call. When I try to run the application, I got the following error in the Logcat.</p> <pre><code>09-03 02:38:16.246: E/AndroidRuntime(1539): FATAL EXCEPTION: main 09-03 02:38:16.246: E/AndroidRuntime(1539): java.lang.NoClassDefFoundError: org.ksoap2.serialization.SoapObject 09-03 02:38:16.246: E/AndroidRuntime(1539): at com.example.updatesnew.MainActivity.onCreate(MainActivity.java:28) </code></pre> <p>MainActivity.java</p> <pre><code>public class MainActivity extends Activity { private static final String SOAP_ACTION = "http://ws.cdyne.com/WeatherWS/GetCityWeatherByZip"; private static final String METHOD_NAME = "GetCityWeatherByZip"; private static final String NAMESPACE ="http://ws.cdyne.com/WeatherWS/"; private static final String URL = "http://wsf.cdyne.com/WeatherWS/Weather.asmx?op=GetCityWeatherByZIP"; TextView tv; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); tv = (TextView) findViewById(R.id.textView01); SoapSerializationEnvelope soapEnvelope = null; //Here I am getting error. SoapObject Request = new SoapObject(NAMESPACE,METHOD_NAME); Request.addProperty("Texas","75011"); soapEnvelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); soapEnvelope.dotNet = true; soapEnvelope.setOutputSoapObject(Request); @SuppressWarnings("deprecation") 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(); } } </code></pre> <p>I also have a doubt, whether <code>Request.addProperty("Texas","75011");</code> is the right way or not, for getting the current temperature of Texas City with ZIP code 75011. Please guide me, with a sample code if possible.</p> <p>Thanks in advance.</p>
    singulars
    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.
 

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