Topic
5 replies Latest Post - ‏2013-10-16T12:18:41Z by YPS1_guybrush_guybrush
SystemAdmin
SystemAdmin
1250 Posts
ACCEPTED ANSWER

Pinned topic Cast Iron & RESTful services

‏2011-01-07T06:56:19Z |
Hi,
Can anybody give some information about how to use RESTful services in Cast Iron?
Updated on 2013-01-25T13:55:04Z at 2013-01-25T13:55:04Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    1250 Posts
    ACCEPTED ANSWER

    RESTful Services

    ‏2011-01-12T14:26:59Z  in response to SystemAdmin

    REST services are most commonly implemented as (serialized) XML over HTTP. To provide a REST service, an orchestration begins with an HTTP Receive Request and probably use a Transform Read XML to convert the HTTP body (string) to an XML document. To invoke a REST service, populate the XML document and serialize it using Transform Write XML. The output string is used to populate the body of an HTTP request that is sent using the HTTP Post Request activitiy.

    • SystemAdmin
      SystemAdmin
      1250 Posts
      ACCEPTED ANSWER

      Re: RESTful Services

      ‏2013-01-25T06:51:35Z  in response to SystemAdmin
      Hi,

      Can we not implement/invoke the Rest web services using the Provide Service and Invoke Service activities provided by Cast Iron?

      Thanks,
      Swetha Rai
      • SystemAdmin
        SystemAdmin
        1250 Posts
        ACCEPTED ANSWER

        Re: RESTful Services

        ‏2013-01-25T13:55:04Z  in response to SystemAdmin
        The Invoke Service and Provide Service activities are intended for use with services that are defined based on WSDL. The WSDL is produced by the provider of the service and used to configure the client that will consume the service. The payload is represented as an XML document (that is transported as string).

        REST is a bit "simpler" since it only requires HTTP. There is no direct equivalent to a WSDL for RESTful services (I am not sure what is happening with WADL). The HTTP methods (POST, GET, PUT, and DELETE) may be involved in supporting a set of CRUD activities. An advantage of release WebSphere Cast Iron release 6.3 is that you can establish HTTP method based listeners instead of using a single listener and then conditionally choosing a path of execution.

        With RESTful services, the structure of the payload that may accompany a POST or PUT must still be mutually agreed upon by the service provider and consumer. JSON is often used for representing structured data but any mutually agreed upon message type may be used.

        Also, WSDL-exposed services may also use invoke using just HTTP. For example, a "Transform Write XML" and "HTTP Post Request" (or Invoke Request from 6.3) can be used in place of a "Web Services Invoke Service". Similarly, a "Web Service Provide Service" is roughly equivalent to a "HTTP Receive Request" followed by a "Transform Read XML".

        A problem with traditional WSDL based web services is that an external SOAP layer is responsible for parsing and serializing the exchanged XML document. If an inbound document cannot be parsed, the sending client gets an HTTP 500 error and the document is never seen by the receiving service.