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. open socket failed: Permission denied when application to run a native C function.

Hi

I port a tool in native C and builed a executable file or a library,
and the executable can work successfully in console (Alt + F1).

Then I creat a SimpleJNI to run the executable or library,
when I click the SimpleJNI icon, it will occure a error message:
:socket err=Permission denied

Is the user not a root such that can not open socket in native C
(Permission denied),
Is there any way to solve this problem ?

Thanks

--~--~---------~--~----~------------~-------~--~----~

2. Are DateFormat and DateUtils supposed to be returning localized strings (1.5 emulator)?

Hi,

I'm currently testing localization on the 1.5 emulator (with sdk
target of 3), I'm using the Custom Locale app to apply different
locales and also I've tried setting it from Settings also. This seems
to update what loads from the res/ folder, so I'm sure this is being
applied.

However I'm trying to use the two classes
android.text.format.DateFormat and android.text.format.DateUtils,
neither seem to be returning localized strings and neither have any
option of setting the locale manually. The documentation suggests that
they should be returning localized strings. Especially
DateUtils.getMonthString() which explicitly states it. Am I missing
something on how to use these classes? I can see in the
android.R.string plenty of related string items fully translated.

If they are meant to be returning localized strings, could someone
please post an example?

Thanks :)

--~--~---------~--~----~------------~-------~--~----~

3. "R cannot be resolved" after updating to 1.5 SDK Pre, and trying to compile for 1.1

4. Using mediaplayer class over HTTPS?

5. Fring on Android Dev Phone 1 (HTC) AT&T provider

6. Se s

7. From XML schemas to Android-Java classes for optimizing XML parsing and browsing