I need to implement soap restfull call in my android and need to handle response in JSON format please provide me simple example for this.
Check this tutorial out, it explains the process pretty well.
Related
Im having issues finding tutorial for this subject. Do anyone have an good example.
I want to send an JSONObject from a android app over http to node.js.
Thanks
OK, start by learning about HTTP & REST to decide whether you want to PUT or POST your JSON.
Create a HTTPRequest in your Android app that puts the JSON into the HTTP message's body. See:
How to send POST request in JSON using HTTPClient?
How to send a JSON object over Request with Android?
Back to node:
Set up a node.js http handler for that type of request. I recommend using express, since it's easy and you'll find the most examples & support when using it.
Use a body parser in express to read the JSON object.
$$$ PROFIT $$$
Hi i am new to android programming and i would like to know how to call a web service and pass parameters to the web service to obtain the return result in form of an XML.
I previously used Ksoap lib and SOAP request but thats not working correct so now i am trying the HTTP method.
Please Help
You will want to read up on the Apache HttpClient.
Beyond that its a matter of making sure the device and server are generating messages that the other side can correctly parse.
Is the server an existing service? Or are you designing that as well?
check the following in which you will use HTTP post request & you will get response in the form on XML
Android HttpPost: how to get the result
i want to access a java web service Running on a Server. which one SOAP or JSON is good to access this web service. i dont want to put overhead on the Server and want the calling of web service to be Fast. plz suggest better way to do this.
JSON and SOAP are two different things. JSON is just a data format while SOAP act as Manager on server side that manage request and response from client.. it can return JSON as a result which is a data format likehttp://stackoverflow.com/questions/9382864/answer/submit XML
You do not access a Web Service with JSON, that is just a format. Depending on the Web Service you might need to communicate with it by sending SOAP envelopes or using REST.
Ok, there is a lot of confusion here. SOAP/REST are two approaches to managing services ON THE SERVER SIDE. SOAP is XML-based, while REST is URL based. Assuming you are writing an Android app, you won't be implementing the SOAP/REST/WSDL interfaces-- you will get them from the service team.
So, if the web service you are using provides both REST and SOAP, then you can choose which set of endpoints to hit.
When you are packaging up your request and sending it to the service, you probably want to package it as JSON. JSON is just "Object Notation." Inherently, it is nothing more than a way to format data in such a way it universally recognized. Alternatively, you can package your request as XML. But JSON is more light-weight, as XML has a lot of required redundancy (unless it is compressed).
What would be best and simplest way to call Yahoo weather webservice/any json webservice in android?
Some people suggest not to use Ksoap for mobile application instead use Restful or Json webservice.
TIA
Bhaskar
In short, use HttpClient, HttpGet, and JSONObject
Without any more details, this is probably similar to what you are attempting: http://www.josecgomez.com/2010/04/30/android-accessing-restfull-web-services-using-json/
Here's another post where this is discussed:
How to call a SOAP web service on Android
If you really want to be simple, just embed the content of the message in a HttpClient (included with Android by default) and manually parse the result.
Here (http://breaking-catch22.com/?p=127) is a link to an example of calling a REST web service.
Have a look at how Google APIs Client Library for Java does it, for example in this YouTube sample using HttpTransport and JSON:
http://code.google.com/p/google-api-java-client/source/browse?repo=samples#hg%2Fyoutube-jsonc-sample%2Fsrc%2Fcom%2Fgoogle%2Fapi%2Fclient%2Fsample%2Fyoutube
I am due to make an android application which sends and recieves data from a .Net web service . I have implemented the HttpGet method in the android and was able to get data in the JSON format .
I will now be implementing the HttpPost method where in i will be sending JSON data to the server.
I was also going through ksoap libary which i think does the soap parsing in the android phone .
Could anyone please tell me why i should/shouldnt be using ksoap and HttpGet and HttpPost methods ?????
As in which amongst this is a better solution KSOAP or (HttpGet/HttpPost) ???
Thanks
kSOAP is a library that deals with the various aspects of the SOA-Protocol. Internally it will use http get and post to communicate with a server.
If you want/need full control over what is sent, direct http may be better. Otherwise I think kSOAP may be better / higher level.