Kind of web services and how to call them from an iphone - iphone

I'm not able to understand the process of calling web services from my iphone application.
Please explain the procedure for calling web services in my iphone application in detail:
How to send request to webservices
How to parse the responses
Which protocol is used to send the request
Which parser is used to retrive the response
Also explain what is SOAP, JSON, HTTP GET & POST, XML and what is the purpose of all these.
I'd be very happy if you send some code for calling web services in iphone application for my easy understanding.
Thank you.

SOAP and REST are web services.. JSON and XML are the formats they (webservices) returns..
you can find about SOAP and REST here..
http://www.taranfx.com/rest-vs-soap-using-http-choosing-the-right-webservice-protocol
find xml and json here.
http://www.subbu.org/blog/2006/08/json-vs-xml
If you are looking for consuming SOAP in iPhone you can read my blog here.
http://www.makebetterthings.com/blogs/iphone/call-soap-web-service-from-iphone/

Related

Should I be using REST or SOAP UI for testing?

I am testing a new webservice that is receiving messages from an application and responding with messages with specific information. The webservice then uses this information to create new messages for downstream systems. I need to know the best way I can test this using the Ready API tool, we just got a pro license. Is it SOAP or REST I need to use. Ideally I want to simply copy my application messages in to the tool, call the webservice and get the response, which I can then check is the correct response for the test
To find your web-service is SOAP or REST.
Please check whether your web service has WSDL to verify it has SOAP web-service, you can get your web-service's WSDL by post-fixing WSDL with your web service url.
Eg: http://{yourservice-url/path1}?WSDL
If your service don't provide WSDL from the above URL, then your web-service is REST.

What is http text post in webservice context?

I am having confusion around http text 'post' in terms of webservice context. We are having a web service which is built on SOAP protocol, now the integration partner wants to eliminate the SOAP portion of the XML message and wants us to post XML message as 'http text post'.
Is this REST HTTP POST? Please clarify.
POST is an HTTP request method, of which there are many (ex. GET, PUT, DELETE, HEAD...). POST is used to submit data to a server for processing, whereas GET (for example) is used to retrieve data for reading. You can read more here. These methods are used for all HTTP communication, whether the target is a SOAP/REST web service or an Apache server hosting a regular website.
SOAP normally operates using POST requests, although it is possible to use GET with SOAP 1.2 as well. GET requests have more restrictive size limitations than POST requests.

iPhone: What protocol service is the best to upload image and then video to server and receiving data from server

I am trying to upload image in one scenario and video in another scenario to a server. Should i use Restful (json format) service (or) Soap (xml) to server. Which one should be efficient?
Also, i need to get the details from server, should i have ask my server engineer to have Restful (json format) (or) Soap (xml) protocol in place in server to send the response to application?
Someone who knows well please advise me.
Thank you.

What is the benefit of RESTful Web Service Vs Using Just a simple Servlet?

Regardless of whether I create a RESTful Web service to be consumed by Ajax in my own pages, or by any user, I can provide the same functionality (data) to the application or user using a simple servlet.
I mean the user or application don't see any different between response provided by a simple servlet or respone provided by a RESTful web service. So, I'm guessing that the benefit is on the server side and to the developers. Can someone please tell me what are the benefits of using RESTful web services.
I appreciate any respone
By definition a webservice is intended to be consumed by any client granted access. If the client you are developing is the only application that you will ever need or want to access the resource then there is little benefit to creating a webservice. However, if you want to make the resource available as a service endpoint for more than just this application in a way that is implementation agnostic then a Restful webservice is a great way of doing it.

creating a POST request in objective-C

I have implemented a REST based web service and used it to access data back in MySQL database.
I am using this framework to access the json data http://code.google.com/p/json-framework/
I have no problems in getting the content from this web service, but how can I put something in the database? Should I just make a special query string and have the php code in the backend to interpret this special keyword/query string as an insert to the database?
You're looking for ASIHTTPRequest. You can use that for everything from dumping pages to submitting data via POST or FORM.
Have fun :)
POST is a HTTP method. Your web service should behave differently depending on the method used for the request, if you're implementing REST.
If you send a POST request, your web service should inspect the parameters and do what it needs to do.
What parameters you send and how is dependent on how you've written the web service. Ie. Is the web service expecting XML requests or JSON or URL parameters?