JBoss.orgCommunity Documentation
Camel binding support in SwitchYard allows Camel components to be used as gateway bindings for services and references within an application.
NOTE: The primary focus of Camel integration in 0.1 was the use of the core EIP routing engine within Camel as a service implementation. Testing for Camel bindings was limited to the Camel File component in 0.1, but this will be expanded considerably in 0.2. If you run into an issue with a specific Camel component in SwitchYard, please let us know in the SwitchYard forum.
Composite-level services can be bound to a Camel component using the
<binding.camel>
binding definition. The following configuration options are available for
binding.camel
:
configURI
: contains the Camel endpoint URI used to configure a Camel component instance
operationSelector
: specification of the operation name to use for the message exchange. If the target service only has a single operation, this setting is optional.
Here's an example of what a service binding looks like using a Camel component.
<sca:composite> <sca:service name="SimpleCamelService" promote="SimpleComponent/SimpleCamelService"> <camel:binding.camel configURI="file://target/input?fileName=test.txt&initialDelay=50&delete=true"> <camel:operationSelector operationName="print"/> </camel:binding.camel> </sca:service> <!-- sca:component definition omitted --> </sca:composite>
Binding a reference with Camel is very similar to binding a service. The only significant difference is that specification of the operationSelector is not required on reference bindings.
<sca:composite> <sca:reference name="WarehouseService" promote="OrderComponent/WarehouseService"> <camel:binding.camel configURI="file://target/output"/> </sca:reference> </sca:composite>
The SOAP component in SwitchYard provides SOAP-based web service binding support for services and references in SwitchYard.
Composite-level services can be exposed as a SOAP-based web service using the
<binding.soap>
binding definition. The following configuration options are available for
binding.soap
when binding services:
wsdl
: location of the WSDL used to describe the web service endpoint. A relative path can be used if the WSDL is included in the deployed application. If the WSDL is located outside the application, then a
file:
or
http:
URL can be used.
serverPort
: port number that the HTTP service should bind to for the SOAP endpoint. Defaults to 8080 if unspecified.
port
: port name in the WSDL to use. If unspecified, the first port definition in the WSDL is used for the service endpoint
The default port of the SOAP binding conflicts with the default listener on JBoss AS, so you must specify a unique port in your configuration when deploying to JBoss AS. Tighter integration with JBoss WS is planned to eliminate this annoying constraint.
Here's an example of what a SOAP service binding looks like:
<sca:composite name="orderApp"> <sca:service name="OrderService" promote="OrderService"> <soap:binding.soap> <soap:wsdl>wsdl/OrderService.wsdl</soap:wsdl> <soap:serverPort>9000</soap:serverPort> </soap:binding.soap> </sca:service> </sca:composite>
Binding a reference with SOAP can be used to make SOAP-based web services available to SwitchYard services. The following configuration options are available for
binding.soap
when binding references:
wsdl
: location of the WSDL used to describe the web service endpoint. A relative path can be used if the WSDL is included in the deployed application. If the WSDL is located outside the application, then a
file:
or
http:
URL can be used.
port
: port name in the WSDL to use. If unspecified, the first port definition in the WSDL is used for the service endpoint.
<sca:composite> <sca:reference name="WarehouseService" promote="OrderComponent/WarehouseService"> <camel:binding.camel configURI="file://target/output"/> </sca:reference> </sca:composite>