Service with SOAP binding (Default transformation)
fenoloco May 31, 2013 10:42 PMHi,
I have just started to play with SY and I have a question.
First I defined a service from a java interface then I added a Bean that implement the interface and finally I defined a SAOP binding.
My files are.
Interface TestService2.java
public interface TestService2 { String echo(String value); String reverse(String value); }
Bean TestService2Imp.java
@Service(TestService2.class) public class TestService2Imp implements TestService2 { @Override public String echo(String value) { return value; } @Override public String reverse(String value) { return new StringBuilder(value).reverse().toString(); } }
switchYard.xml
<?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:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912" xmlns:soap="urn:switchyard-component-soap:config:1.0" name="SW-SOAP" targetNamespace="urn:com.example.switchyard:SW-SOAP:1.0"> <sca:composite name="SW-SOAP" targetNamespace="urn:com.example.switchyard:SW-SOAP:1.0"> <sca:service name="TestService2" promote="TestService2Impl/TestService2"> <sca:interface.java interface="com.example.switchyard.SW_SOAP.TestService2"/> <soap:binding.soap> <soap:contextMapper/> <soap:wsdl>META-INF/TestService2.wsdl</soap:wsdl> <soap:wsdlPort>TestService2Port</soap:wsdlPort> <soap:socketAddr>:8080</soap:socketAddr> <soap:contextPath>SW-SOAP</soap:contextPath> <soap:endpointAddress>http://localhost:8080/SW-SOAP/TestService2</soap:endpointAddress> </soap:binding.soap> </sca:service> <sca:component name="TestService2Impl"> <bean:implementation.bean class="com.example.switchyard.SW_SOAP.TestService2Impl"/> <sca:service name="TestService2"> <sca:interface.java interface="com.example.switchyard.SW_SOAP.TestService2"/> </sca:service> </sca:component> </sca:composite> </switchyard>
When I invoke the method, the value param have all the xml of the request, I think I have to define a transformation to get the parameters.
The question is: I will have to define a transformation ( by hand ) for all my WS?
Thanks in advance,