Jirka created a very good sample that is attached here:
I would like to explain the sample and highlight the two issues here.
The sample has 2 services, ErrorService and ProxyService. Both of them are exposed as Webservices via SOAP binding. ProxyService references the Webservice exposed by ErrorService.
There are two issues with the sample:
The reference binding is not properly configured, yet the application gets deployed. The configuration is
<reference name="RemoteService" promote="RemoteService"> <binding.soap xmlns="urn:switchyard-component-soap:config:1.0"> <wsdl>wsdl/ErrorService.wsdl</wsdl> <port>ErrorServicePort</port> </binding.soap> </reference>
causes the following exception
Caused by: org.switchyard.component.bean.BeanComponentException: Bean Component invocation failure. Operation 'echoTwoWay' is not defined on Service 'RemoteService'. at org.switchyard.component.bean.ClientProxyBean$ClientProxyInvocationHandler.createExchange(ClientProxyBean.java:337) at org.switchyard.component.bean.ClientProxyBean$ClientProxyInvocationHandler.invoke(ClientProxyBean.java:290)
Not sure if this is the right message. However changing the configuration like this, solves this issue.
<reference name="RemoteService" promote="ProxyService/RemoteService"> <binding.soap xmlns="urn:switchyard-component-soap:config:1.0"> <wsdl>wsdl/ErrorService.wsdl</wsdl> <port>ErrorServicePort</port> </binding.soap> </reference>
- The sample assumes that injecting a @Reference to the Webservice consumer RemoteService will automagically convert the Java Object to SOAP request and transform it back to Java Object from SOAP response. This I am not sure we have implemented , I guess.
So obviously the said JIRA issue above has to be split into two issues. Now I am vey keen in knowing about the point 2 above. Are we missing any default transformer configuration?
PS: You will need to clean up the sample and replace the ip address with localhost. This was tested with AS7.