advertisement
Login | Register   
  Include Code  Search Tips
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sidebar 1. ESB Architecture
Partners & Affiliates
advertisement
advertisement
advertisement
advertisement
Average Rating: 1/5 | Rate this item | 12 users have rated this item.
Connecting RESTful Web Services to an ESB (cont'd)
Specialized REST Adapter
Popular open source ESB products, such as Mule, provide REST adapters as part of their product offerings. Mule offers a REST wrapper that is very simple to set up and configure. Configuration steps include setting up all the common parameters that characterize the RESTful web service, such as URL, HTTP method type, query parameters, HTTP error handler, etc.
advertisement

The following is an example of Mule's configuration file for the RESTful adapter, which invokes the RESTful web service presented in my previous DevX article "RESTful Web Services: The Keep-It-Simple Style":


<mule-descriptor name="HTTPPostSample" implementation="org.mule.components.rest.RestServiceWrapper" 
singleton="false" initialState="started"> <inbound-router matchAll="false"> <endpoint address="stream://System.in" type="senderAndReceiver" /> </inbound-router> <outbound-router matchAll="false"> <router className="org.mule.routing.outbound.FilteringOutboundRouter" enableCorrelation="IF_NOT_SET"> <endpoint address="stream://System.out" transformers="XmlDecoder Xslt XmlToObject" type="senderAndReceiver" /> </router> </outbound-router> <properties> <property name="serviceUrl" value="http://mycompany.com/shipments/PrintShipmentRoute" /> <property name="payloadParameterName" value="shipment_id" /> <property name="httpMethod" value="GET" /> </properties> </mule-descriptor>

All other parameters such as payloadParameterName are optional, but the urlFromMessage parameter is of particular interest when integrating ESB Mule with canonical web services. With this parameter set, Mule ESB will look into a message for the value of the rest.service.url parameter, which represents the URL of the RESTful web service to be invoked.

This option enables Mule to access RESTful URLs that universally represent entities (e.g., shipment ID is part of the URL), which is in accordance with the best practices for RESTful web services.

Previous Page: Introduction Next Page: HTTP/S Adapter
Page 1: IntroductionPage 3: HTTP/S Adapter
Page 2: Specialized REST AdapterPage 4: Custom ESB Adapter
Please rate this item (5=best)
 1  2  3  4  5
advertisement