Well,

you can use the following code (and later put JSON libs to handle the
response)

String res="";
    HttpClient client = new DefaultHttpClient();
    HttpPost post = new HttpPost("http://10.1.1.3:8080/AllertWS/
AllertWSService");
        try {
            post.setHeader("Content-Type", "text/xml");
            post.setEntity(new StringEntity(xmlDeEntrada));

            HttpResponse httpResponse = client.execute(post);
                if(httpResponse.getStatusLine().getStatusCode()!=404)
{
                    res=
EntityUtils.toString(httpResponse.getEntity());
                    tv.setText(res);
                }else
                    tv.setText("404 :(");
        } catch (Exception e) {
            tv.setText("Erro: "+e.getLocalizedMessage());
        } finally {
            post.abort();
            post=null;
        }

Cheers,
Cezar Signori

On Oct 2, 9:51 pm, Charlie Collins <[EMAIL PROTECTED]> wrote:
> If you search this forum you find a lot of info on this topic. It
> depends what you mean by "webservice," but if you mean SOAP over
> HTTP,  the typical path is to use kSOAP on Android. Anddev.org has
> some good samples, including a kSOAP 
> one:http://www.anddev.org/webservice_soap_with_complex_data_type_and_ksoa....
>
> Though, I would also still argue that you should not use SOAP on a
> small embedded platform device like a mobile phone. I know, I know,
> relax - people do it all the time, and many people disagree - I
> realize that.  But still the stuff that makes SOAP useful,
> transactions, types, orchestration, etc, are all overkill in my
> opinion on an embedded device. You can avoid all that overhead (and
> even the envelope), and STILL use your existing SOAP service, by
> making a SOAP proxy using something that takes more of a plain HTTP
> and XML appoach (POX), or even REST, and have that proxy make the
> required SOAP calls. Put all the SOAP horsepower on the server, if you
> have to use SOAP, and make the Android client ultra simple via some
> kind of a proxy.
>
> On Oct 2, 12:15 pm, "Yash Patel" <[EMAIL PROTECTED]> wrote:
>
> > Hi Guys,
>
> > Can anyone please let me know how how do we call webserivce from Android
> > App.
> > If you can provide sample code, i would really appreciate.
>
> > thanks for you help.
>
> > Yash Patel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to