Tuesday, July 17, 2012

Proxy Services with WSO2 ESB

First lets try to figure out 'What is a proxy service?'
"Proxy services define virtual services hosted on the ESB that can accept requests, mediate them, and deliver them to an actual service. Proxy services could perform transport or interface switching and expose different semantics than the actual service, i.e., WSDL, policies, and QoS aspects like WS-RM, WS-Security, etc."[1]


Another important term is 'endpoint'
An endpoint is a specific destination for a message. It may be specified as an Address endpoint, WSDL endpoint, a fail over group, or a load balance group.


OK , Lets create a proxy service (Pass Through Proxy) for version service


Give the proxy name as - 'Pass Through Proxy'
Target URL - http://localhost:8280/services/Version (We will use the endpoint of Version service here )


When publishing the WSDL select "specify source uri
WSDL URL - http://localhost:8280/services/Version?wsdl
If you ar eno using the UI, Please refere the following configuration.



<proxy xmlns="http://ws.apache.org/ns/synapse" name="Proxy" transports="https,http" statistics="disable" trace="disable" startOnLoad="true">
   <target>
      <outSequence>
         <send />
      </outSequence>
      <endpoint>
         <address uri="http://localhost:8280/services/Version" />
      </endpoint>
   </target>
   <publishWSDL uri="http://localhost:8280/services/Version?wsdl" />
</proxy>




Press OK, and the proxy is created. From the ESB, you can find the newly created proxy service at (Web Services -> list)






[1] http://wso2.org/project/esb/java/4.0.3/docs/user_guide.html#Proxy
[2] http://wso2.org/project/esb/java/4.0.3/docs/samples/proxy_samples.html

No comments:

Post a Comment

Constructor Chaining