SCA Interface required for Service or not?
sdirbach Dec 12, 2013 7:20 AMHi,
imagine the following switchyard service, that reads a file through a camel producer and passes it as a message to a camel route.
<?xml version="1.0" encoding="UTF-8"?> <switchyard xmlns="urn:switchyard-config:switchyard:1.0" xmlns:bean="urn:switchyard-component-bean:config:1.0" xmlns:camel="urn:switchyard-component-camel:config:1.0" xmlns:camel_1="urn:switchyard-component-camel-core:config:1.0" xmlns:file="urn:switchyard-component-camel-file:config:1.0" xmlns:quartz="urn:switchyard-component-camel-quartz:config:1.0" xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912" name="switchyard-fs-example" targetNamespace="urn:com.example.switchyard:switchyard-fs-example:1.0"> <sca:composite name="switchyard-fs-example" targetNamespace="urn:com.example.switchyard:switchyard-fs-example:1.0"> <sca:service name="TestService" promote="CamelServiceRoute/TestService"> <file:binding.file name="fileBinding"> <operationSelector operationName="doSomething"/> <file:contextMapper class="com.example.switchyard.switchyard_fs_example.MyCM"/> <file:directory>/home/sascha/sy-test</file:directory> <file:consume> <file:move>archive/$${file:onlyname}.$${date:now:yyyyMMddHHmmss.SSS}</file:move> <file:moveFailed>error/$${file:onlyname}.$${date:now:yyyyMMddHHmmss.SSS}</file:moveFailed> <file:idempotent>false</file:idempotent> </file:consume> </file:binding.file> </sca:service> <sca:component name="CamelServiceRoute"> <camel:implementation.camel> <camel:java class="com.example.switchyard.switchyard_fs_example.CamelServiceRoute"/> </camel:implementation.camel> </sca:component> </sca:composite> </switchyard>
Do I need to add an interface (Java, WSDL, ESB-Type) to the Service? What would this interface look like for a camel binding?
From what I experienced, it works fine without an interface (It's optional in the SCA spec) and gets ignored when it is specified. Anyway, the designer does not allow to create services without interfaces and I read somewhere, that an Interface is always required for a SCA Service.
What do you think on that?
Kind regards,
Sascha