Using SOAP and REST

I have successfully used the SOAP service.

Suppose there is a web service that provides a method that returns a list of students.

public Student[] listAllStudents(){
  //some code that return Student array
}

Using SOAP will require the following actions:

  • Get the URL to host the WSDL.
    eg.http://127.0.0.1/web/service/location/soap.php?wsdl
  • To create all stub classes, use some available technologies, such as axistools-maven-plugin . A generated class with a name of type Student will be created.
  • Use the appropriate stub class / interface to invoke the service.

    Student[] students = theStub.list_All_Students();

Using a REST service would be something like this.

  • Get the correct URL to get the student list.
    eg.http://127.0.0.1/web/service/student/list?sort=true
  • URL, java.net.HttpURLConnection, , JSON.
  • .

Java, SOAP, . , URL, , -.

REST . URL, , . REST .

:

  • REST?
  • , REST?
+5
5

1. , - REST?

REST . - , SOAP. : enter image description here

, , . SOAP , . REST , HTTP. , . WADL , REST.

2. , REST?

. REST , JAX-RS, Jersey, RESTEasy Restlet.

+10

, REST , , . , SOAP javascript, php . SOAP , , , - #.

, , RESTful Jackson ( JSON), RestController Spring JAX-RS.

+3

, , , REST . , REST "" , -, HTTP-, - "GET", "POST", "DELETE", "PUT". "GET" "POST". , - HTTP webservice , , HTTP. ( REST) ​​HTTP "dummy" ( ) , . HTTP : ", " "" ". -, ?"

 REST uses these operations and other existing features of the HTTP protocol. 
 For example, layered proxy and gateway components perform additional functions 
 on the network, such as HTTP caching and security enforcement.

SOAP over REST , , TCP, . REST , HTTP. HTTP REST, , HTTP.

REST - JAX-RS Jersey .

, !

+2

REST -/ . . . REST ( ).

SOAP - /. SOAP /// // .

Java-, , REST /, JSR-311, , Jersey Resteasy. , - .

twitter :):

- , linkedin API SOAP

8:22 pm · 3 13 · Twitter iPhone

+1

, , .

SOAP , - , (attributeFormDefault, RPC/encoded vs Document/literal ..). REST URL-, SOAP , .

, SOAP. , .

JAX-RS , Jersey, Restlet,.. REST, Jackson, XStream .. JSON, REST .

+1

All Articles