I am using the ksoap library to consume .net webservice. One of the request returns a very larger xml response.The thing is ksoap shows only partial response.But the wireshark trace shows xml response as sequence of TCP segments which represent the bulk XML.
any idea to grab full xml response?
You can modify HttpTransportSE.java file for saving WS response directly in a xml file. Then you can parse it as you prefer. Last ksoap release (3.0.0) has got a method for saving response in a file if you don't want modify java class.
Related
i only have a .wsdl file locally and i only find examples for android to create a soap service with retrofit2 with an url. Now my question is what is best practice to store the .wsdl file in the project (is this a raw file?) and parse this for example with ksoap to create my api with retrofit? Any body some ideas?
The WSDL file is a webservice file, therefore it should seat on your server, you can deploy such webservices using Tomcat or JBoss applications. So you don't want to 'store' the wsdl file in your application, it should seat on your server. And you shouldn't 'parse' a wsdl file, its function is moving data from your client to server and viceversa. If doing what you are suggesting was possible(parsing with ksoap to create my api with retrofit), then it would be a bad programming practise due to redudancy. Retrofit works similarly to soap difference being retrofit makes use of JSON while SOAP makes use of XML. Try looking at my answer here Call a soap webservice in android to understand how android interacts with soap webservice
I am working on code that will call a SOAP webservice under Android Java code, but in doing so I am not able to consume it, it's not returning any results.
I am giving two integers as input, and it will add the result in an output variable. For this I have called a webservice.
Also I am not sure based on this WSDL format what should I take as
1.namespace,sooapaction,method
PLEASE FIND MY CODE IN BELOW URL
https://gist.github.com/deedood/9572246/revisions
I have an application which uses restful web services, the service returns a json object.
I wanted to know , what would be better , returning a json or xml response?
Please help as i am new to the concept.
The answer is that it doesn't really matter. They are both almost equivalent. They use slightly different API's so go with the one you feel more comfortable with.
Example of JSON parsing in Android you can find in this question.
Example of XML parsing in Android you can find in this question.
The only reason I can think of to use XML over JSON is when your webservice responses are huge. JSON usually requires the entire response to arrive before you can start parsing. XML easily supports a pull parser which can start parsing "on the fly" before all the data arrives - which can be much more efficient. But if your responses are small, you don't really need all that.
If your existing webservice already returns a JSON object, this could be reason enough to stick with JSON.
I am using wordpress in my website. I want the response from server to be xml response. I came to know that if i use JSON API plugin then i will get json response from server. Right now i am getting html response from server. How to get XML response from server is there any plugin?
take a Look here How to echo xml file in php. I think that is you want to do.
Hope it will helps you.
XML parser: http://developer.android.com/training/basics/network-ops/xml.html
I want to know how to parse the web service response data in android .Actually i m accessing the .net web service.I can get a result of some complex type.i want to know how to retrive a particular value from this complex type.Is there is any parser avilable to parse the content of the response or else we have to parse manually? If u have any code snippet pls bring me.
First of all - what content type you are talking about? XML and JSON are supported I believe. I've been using just plain HttpClient to get the responses
if you need to parse XML response, see here:
http://www.helloandroid.com/node/110
it's a sample XML RSS reader