[Architecture] REST with ESB
amila at wso2.com
Sun Feb 20 21:13:42 EST 2011
On Sun, Feb 20, 2011 at 10:42 AM, Supun Kamburugamuva <supun at wso2.com>wrote:
> REST is a way of accessing resources in a server over HTTP. But from
> the ESB point of view non of these resources are in ESB. So from the
> ESB point of view REST is just HTTP traffic passing through the ESB.
ESB transforms, mediate and route the messages it receives.
In that sense isn't it a valid scenario to use ESB to transform rest into
Soap or Soap into rest?
> But the problem is we don't treat this traffic as just HTTP traffic.
> Let me explain how REST is handled in the ESB as of now.
> When a non entity enclosing method like GET, HEAD comes to a ESB proxy
> service, it is converted in to a SOAP message by the Axis2 Message
> Builders. Then inside the ESB these messages can be accessed as XML
> and when we send the message out Axis2 again converts the message in
> to a GET/HEAD request.
> When an entity enclosing request like POST comes the request XML is
> wrapped inside a SOAP message by the Axis2. When we send the message
> out ESB un-wraps this XML inside the SOAP envelope and send the
> message out.
> For POST cases ESB works reasonably well because there is no matching.
> For GET cases, not all URLs can be matched to a XML. Our proxy
> services are web services with a WSDL. This makes the thing messy
> because if we have a GET request that cannot be matched to a XML, this
> proxy service shouldn't have a WSDL. But even if the WSDL is not
> specified for the proxy we generate a dummy WSDL.
> So for GET requests that doesn't have a direct XML mapping we should
> ideally process it inside the main sequence. But processing inside the
> main sequence is really complex.
> How about introducing first class HTTP message support for the ESB?
> For example we can have a proxy service type called REST. These proxy
> services doesn't try to convert a GET request to a XML structure and
> doesn't have a WSDL.
> The default behavior of a REST proxy service, with the name REST_PROXY
> and pointing to back-end endpoint http://back-end/services/test is
> we get the GET request http://esb-host/REST_PROXY/myservice?param1=value1
> We send the following request to the back end by default
> Supun Kamburugamuva
> Technical Lead & Product Manager, WSO2 Inc.; http://wso2.com
> Member, Apache Software Foundation; http://www.apache.org
> WSO2 Inc.; http://wso2.org
> E-mail: supun at wso2.com; Mobile: +94 77 431 3585
> Blog: http://supunk.blogspot.com
> Architecture mailing list
> Architecture at wso2.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Architecture