Web service client VerifyError

Problems with WiFi, SQLite ,Bluetooth, WiMax, Proxies, etc...

Web service client VerifyError

Postby zahidalinaqvi » Thu Sep 03, 2009 11:55 pm

Hello,

I want to create a webservice client in my android application but i m getting VerifyError when i m try to run it.




Please have a look on the attached image.

Thanks
Zahid Naqvi
zahidalinaqvi@gmail.com

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. package a.t.m;
  2.  
  3.  
  4.  
  5. import java.util.Vector;
  6.  
  7.  
  8.  
  9. import org.ksoap2.SoapEnvelope;
  10.  
  11. import org.ksoap2.serialization.SoapObject;
  12.  
  13. import org.ksoap2.serialization.SoapSerializationEnvelope;
  14.  
  15. import org.ksoap2.transport.HttpTransport;
  16.  
  17.  
  18.  
  19. import android.app.Activity;
  20.  
  21. import android.os.Bundle;
  22.  
  23. import android.widget.TextView;
  24.  
  25.  
  26.  
  27. public class First extends Activity {
  28.  
  29.     private static final String SOAP_ACTION = "http://tempuri.org/LocateSameAddress";
  30.  
  31.     private static final String METHOD_NAME = "LocateSameAddress";
  32.  
  33.     private static final String NAMESPACE = "http://tempuri.org/";
  34.  
  35.     // !!!!! IMPORTANT!!!!! THE URL OF THE CoLDFUSION WEBSERVER NOT LOCALHOST BECAUSE LOCALHOST IS THE ANDROID EMULATOR !!!!!
  36.  
  37.     private static final String URL = "http://74.54.60.18:2226/service.asmx?WSDL";
  38.  
  39.    
  40.  
  41.     /** Called when the activity is first created. */
  42.  
  43.     @Override
  44.  
  45.     public void onCreate(Bundle icicle) {
  46.  
  47.         super.onCreate(icicle);
  48.  
  49.         setContentView(R.layout.main);
  50.  
  51.  
  52.  
  53.      //CALL the web service method with the two parameters vname and nname
  54.  
  55.         SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
  56.  
  57.         request.addProperty("LATITUDE", "44.7959");
  58.  
  59.         request.addProperty("LONGITUDE", "=-91.4435");
  60.  
  61.         request.addProperty("mile", "5");
  62.  
  63.         request.addProperty("Type", "AT");
  64.  
  65.  
  66.  
  67.         SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
  68.  
  69.         envelope.setOutputSoapObject(request);
  70.  
  71.         HttpTransport androidHttpTransport = new HttpTransport (URL);  
  72.  
  73.        
  74.  
  75.         try {
  76.  
  77.           androidHttpTransport.call(SOAP_ACTION, envelope);
  78.  
  79.          
  80.  
  81.           // Get the SAOP Envelope back and the extract the body
  82.  
  83.           SoapObject resultsRequestSOAP = (SoapObject) envelope.bodyIn;
  84.  
  85.          
  86.  
  87.          /* Vector XXXX = (Vector) resultsRequestSOAP.getProperty("getMessageReturn");
  88.  
  89.          
  90.  
  91.                //Count of the arrays beneath starting from 0
  92.  
  93.           //You can see the buildup with the php site with nusoap http://localhost/DA/nusoapclient_test2.php
  94.  
  95.           int testat = XXXX.size();
  96.  
  97.          
  98.  
  99.           // It depends on how many arrays we  have we can get to the attributs of one of them with get(0), get(1) ....
  100.  
  101.           SoapObject test = (SoapObject) XXXX.get(0);
  102.  
  103.          
  104.  
  105.           //Get the attributes in the array
  106.  
  107.           String tem = (String) test.getProperty("LATITUDE");
  108.  
  109.           tem = tem + " " + (String) test.getProperty("LONGITUDE");
  110.  
  111.           tem = tem + " " + (String) test.getProperty("mile");
  112.  
  113.           tem = tem + " " + (String) test.getProperty("Type");*/
  114.  
  115.          
  116.  
  117.           //Just show it in a text area field called lblStatus
  118.  
  119.           ((TextView)findViewById(R.id.lblStatus)).setText(resultsRequestSOAP.toString());  
  120.  
  121.          
  122.  
  123.          
  124.  
  125.          
  126.  
  127.           // with androidhttptransport you need a catch block
  128.  
  129.  
  130.  
  131.         } catch(Exception E) {
  132.  
  133.           ((TextView)findViewById(R.id.lblStatus)).setText("ERROR:" + E.getClass().getName() + ": " + E.getMessage());
  134.  
  135.         }
  136.  
  137.  
  138.  
  139.     }
  140.  
  141. }
Parsed in 0.041 seconds, using GeSHi 1.0.8.4
Attachments
First.java
(2.91 KiB) Downloaded 59 times
Error.PNG
Error.PNG (26.91 KiB) Viewed 236 times
User avatar
zahidalinaqvi
Developer
Developer
 
Posts: 35
Joined: Mon Aug 11, 2008 8:54 am
Location: Jaipur India

Top

Postby sudheer1437 » Tue Sep 08, 2009 7:47 am

hi...
did u get the solution for this.
i am too working on this only. i am trying to convert the string into input stream and then parse it using DOM parser. i am able to get the input stream. but the input stream consists of curly braces({}) which i dont find on the original xml file.

So wen i try to parse this input stream, its giving me error as Unknown characters.

So can u give me any solution for this...

Thanks in advance..
sudheer1437
Experienced Developer
Experienced Developer
 
Posts: 79
Joined: Sat Aug 08, 2009 7:42 am
Location: India

Postby zahidalinaqvi » Tue Sep 08, 2009 3:48 pm

can u send me the code plz or contact me on zahidalinaqvi@gmail.com

I did this part successfully.
User avatar
zahidalinaqvi
Developer
Developer
 
Posts: 35
Joined: Mon Aug 11, 2008 8:54 am
Location: Jaipur India

Top

Return to Networking & Database Problems

Who is online

Users browsing this forum: Yahoo [Bot] and 6 guests