How SOAP and REST work with XML/JSON response?

前端 未结 3 1291
被撕碎了的回忆
被撕碎了的回忆 2021-01-30 07:53

This is one very common question asked again and again on stack overflow and I read so many answers about this but I am still bit confused.

I need to call the webservice

3条回答
  •  天命终不由人
    2021-01-30 08:32

    SOAP - "Simple Object Access Protocol"

    SOAP is a method of transferring messages, or small amounts of information, over the Internet. SOAP messages are formatted in XML and are typically sent using HTTP (hypertext transfer protocol).

    So SOAP has a standard how a message has to be sent.

    Each soap web service can be defined with a WSDL(Web Service Definition Language) which is kind of a schema for the SOAP XML transferred.

    There are many tools available to convert WSDL(your webservice definition) to native code.

    One of the tool available for ObjC is Sudz-C (http://sudzc.com/) which convert the WDSL of any webservice to ObjC code to access the Web service.


    Rest - Representational state transfer

    Rest is a simple way of sending and receiving data between client and server and it don't have any much standards defined , You can send and receive data as JSON,XML or even a Text. Its Light weighted compared to SOAP.

    To handle Rest in iOS there are many tools available, I would recommend RestKit http://restkit.org/, for handling XML and JSON both.

    I would suggest you to go with Rest for mobile development, since its light weight SOAP vs REST

    (Simple example, People correct me If I am wrong)

提交回复
热议问题