Support of Representational State Transfer (REST)

The XML/SOAP Listener supports REST architecture. This document covers the following topics:


GET Manner

The XML/SOAP Listener supports simple requests in GET manner. In this context, GET means retrieving information (in the form of an entity) that is identified by the request URI.

A service accepts a request in plain XML, so the response format is also plain XML. The parameter names must match those of the service.

The request is formed as follows:

<URL_of_the_XML_service>/<program_name>?<parameter_1>=<value_1>&<parameter_2>=<value_2>...

Limitations

  • The request document cannot contain groups, arrays, other nested elements, or attributes.

  • Elements cannot be namespace-qualified.

  • Only services that accept requests in plain XML can be called.

Example

Enter the following GET request in the URL field of your Web browser:

http://localhost:8080/wsstack/services/example/CALC?Operation=+&Operand_1=20&Operand_2=36

The actual request is:

GET /wsstack/services/example/CALC?Operation=+&Operand_1=20&Operand_2=36 HTTP/1.1
Content-Type: application/x-www-form-urlencoded; charset=UTF-8;action="CALC";
SOAPAction: CALC
User-Agent: Axis2
Host: localhost:8080

Your browser will display something like the following:

<CALC>
    <Function_Result>56</Function_Result>
</CALC>

The actual response is:

HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Type: application/xml;charset=utf-8
Transfer-Encoding: chunked
Date: Thu, 07 Aug 2008 12:25:44 GMT

32
<CALC><Function_Result>56</Function_Result></CALC>
0