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

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

    RESTful Services

    ‏2011-01-12T14:26:59Z  

    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

    Re: RESTful Services

    ‏2013-01-25T06:51:35Z  

    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.

    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

    Re: RESTful Services

    ‏2013-01-25T13:55:04Z  
    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
    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.
  • SwethaRai
    SwethaRai
    48 Posts

    Re: RESTful Services

    ‏2013-10-16T11:20:45Z  
    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.

    Thanks a lot for this detailed response.

    Could you please help with an example of REST based cast iron orchestration?

     

  • YPS1_guybrush_guybrush
    47 Posts

    Re: RESTful Services

    ‏2013-10-16T12:18:41Z  
    • SwethaRai
    • ‏2013-10-16T11:20:45Z

    Thanks a lot for this detailed response.

    Could you please help with an example of REST based cast iron orchestration?

     

    http://www.ibm.com/developerworks/views/websphere/libraryview.jsp?site_id=1&contentarea_by=WebSphere&sort_by=Date&sort_order=2&start=1&end=26&topic_by=-1&product_by=-1&type_by=All%20Types&show_abstract=true&search_by=Cast%20Iron&industry_by=-1&series_title_by=

    Have a look on the articles here, i'm suppose it contained enough reference to start with REST based implementation.