Question of using ksoap for android to call webservices

by Dave Shen » Fri, 07 Jan 2011 02:32:32 GMT


Sponsored Links
 I am trying to develop an android application using our webservice.

Here is the code:

        private String SOAP_ACTION= "http://.../TestFunction";
        private String METHOD_NAME = "TestFunction";
        private String NAMESPACE = "http://.../";
        private String URL = "http://.../webservice.php";

                   SoapObject request = new SoapObject(NAMESPACE,
METHOD_NAME);
        SoapSerializationEnvelope envelope = new
SoapSerializationEnvelope(SoapEnvelope.VER11);
        envelope.setOutputSoapObject(request);

        HttpTransport  androidHttpTransport = new HttpTransport(URL);
        androidHttpTransport.call(SOAP_ACTION, envelope);


The testfunction is a function without any parameters or return
values. It is tested correctly using other applications.
As long as calling to the last line of code, the emulator exited.
I tried Eclipse, Ksoap2 in both Windows and Ubuntu.

Can anyone help? Many thanks!

Some small questions:
1) do i need to use "....php?wsdl" in URL?
2) do i need to use explict IP address in URL?
3) should I use androidhttptransport? Is it in the ksoap for android?
i downloaded but the JAR generates a compile error.
4) Is there any specific requirement for the webservices?

-- 



Other Threads

1. retrieving freeMemory(), totalMemory() & MaxMemory from other applications

Is there a way to retrieve the free memory, total memory and maximum
memory of other applications/processes using my application? I use
Runtime.getRuntime().freeMemory() but it can only retrieve your
current application... If there's somehow a method where I can just
input their PIDs or Package Names like "Runtime.getRuntime().freeMemory
().packageName" for example.. Here's my code...

int availProc = Runtime.getRuntime().availableProcessors();
                long total = Runtime.getRuntime().totalMemory();
                long free = Runtime.getRuntime().freeMemory();
                long max = Runtime.getRuntime().maxMemory();

                Toast.makeText(getApplicationContext(),availProc + "\nTM "
                                + Long.toString(total) + "\nFM " + 
Long.toString(free)
                                + "\nMM" + Long.toString(max),
 
Toast.LENGTH_SHORT).show();
                }
--~--~---------~--~----~------------~-------~--~----~

2. BufferedReader problem

Hi all,

I encountered the problem that the BufferedReader causes garbled
characters when I read UTF-8 file.
I confirmed that this problem occurred on both Emulator(1.5) and ADP1
(1.5).

I posted same message into Japanese community.
<

3. Media AspectRatio

4. "Complete Action Using" dialog

5. Updating framework - How to include new Java classes for android.jar

6. How to deactivate camera

7. Updating framework - How to include new Java classes for android.jar