Hi folks,I am apparently a bear of very little brain and I am attempting to get working what in my mind should be a very simple case: Have a component reference an external web service (implemented in this case via Spring Web Services). I've followed an example I believe posted by ant called Translator but I've mostly been banging my head repeatedly for several days getting nowhere.
I've plowed through some of the reference docs as well as the Tuscany documentation I can find and any examples in the download, but I'm missing something fundamental somewhere and I am reaching out for guidance - apologies in advance for the newbieness of the post. But, hey, I'm very new at Tuscany and SCA in general.
Here's the (I believe) simple setup:
1.) I've got a WSDL and supporting schemas:
src/
Customer.wsdl
{schemas - namespace imports in WSDL}
Customer.composite - which has been stripped bare:
<?xml version="1.0" encoding="ISO-8859-15"?>
<sca:composite xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
name="Customer" targetNamespace="http://customer">
<sca:component name="CustomerServiceComponent"><sca:implementation.java class="services.CustomerServiceComponentImpl"/>
<sca:reference name="customerWs">
<sca:binding.ws
wsdlElement="http://customer/comcast/:#wsdl.port(CustomerService/CustomerPort)"/>
</sca:reference>
</sca:component>
</sca:composite>
Compare this to the translator example (which I can get to work):
<?xml version="1.0" encoding="UTF-8"?>
<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
targetNamespace="http://sample" name="Translator">
<component name="TranslationService">
<implementation.java class="translate.TranslationServiceImpl" />
<reference name="translator">
<binding.ws
wsdlElement="http://tempuri.org/#wsdl.port(Translator/TranslatorSoap)" />
</reference>
</component>
</composite>
Then I've got bare-bones implementation classes and interfaces.
src/services:
CustomerWS - interface which represents the reference service
package services;
public interface CustomerWS {
}
CustomerServiceComponent - interface for the component
package services;
public interface CustomerServiceComponent {
}
CustomerServiceComponentImpl - implementation class
package services;
import org.osoa.sca.annotations.Reference;
import org.osoa.sca.annotations.Service;
@Service(CustomerServiceComponent.class)
public class CustomerServiceComponentImpl implements
CustomerServiceComponent {
private CustomerWS customerWs;
@Reference
public void setCustomerWs(CustomerWS customerWs) {
this.customerWs = customerWs;
}
}
CustomerServiceClient - client class
Right now, this is all very, very stripped down as you can see. However,
even when it has similar methods from the Translator example, it still
can't past the line:
SCADomain domain = SCADomain.newInstance("Customer.composite");
in the client class.
I get:
SEVERE: Interface not remotable: services.CustomerWS
Exception in thread "main" org.osoa.sca.ServiceRuntimeException:
org.osoa.sca.ServiceRuntimeException: Interface not remotable:
services.CustomerWS
at
org.apache.tuscany.sca.host.embedded.SCADomain.createNewInstance(SCADomain.java:276)
at
org.apache.tuscany.sca.host.embedded.SCADomain.newInstance(SCADomain.java:70)
at services.CustomerServiceClient.main(CustomerServiceClient.java:8)
Caused by: org.osoa.sca.ServiceRuntimeException: Interface not
remotable: services.CustomerWS
at
org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain.analyseProblems(DefaultSCADomain.java:309)
at
org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain.init(DefaultSCADomain.java:239)
at
org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain.<init>(DefaultSCADomain.java:120)
at
org.apache.tuscany.sca.host.embedded.SCADomain.createNewInstance(SCADomain.java:242)
... 2 more
And I thought I might need to add @Remotable to the service interface,
but the translator example doesn't have it and that brought up all kinds
of other issues as well.
So, sorry for the long post, but any guidance on actual steps for referencing an external service in a component would be most helpful - and if I've missed docs somewhere outlining, I'm all for going off and reading, I just haven't seen it.
Thanks very much for your time! Ray
smime.p7s
Description: S/MIME Cryptographic Signature
