tuscany-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ray Harrison <r.harr...@comcast.net>
Subject Re: Tuscany / External Web Services
Date Thu, 06 Nov 2008 16:56:09 GMT
Ray Harrison wrote:
> Simon Laws wrote:
>> On Thu, Nov 6, 2008 at 1:50 PM, Ray Harrison <r.harris1@comcast.net> 
>> wrote:
>>
>>> 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)<http://customer/comcast/:#wsdl.port%28CustomerService/CustomerPort%29>

>>>
>>> "/>
>>>    </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)<http://tempuri.org/#wsdl.port%28Translator/TranslatorSoap%29>"

>>>
>>> />
>>>        </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
>>>
>>>
>>>
>> Hi Ray
>>
>> Doesn't look like you are missing anything fundamental to me.
>>
>> As far as I know the interface CustomerWS should be marked as 
>> @Remotable as
>> binding.ws is a remotable binding. I surfed up that Translator sample 
>> that
>> Ant made and you are right that @Remotable doesn''t appear. Very 
>> strange. I
>> don't know how that worked (assuming it did).
>>
>> What were the issues you saw when you added @Remotable to the service
>> interface?
>>
>> Regards
>>
>> Simon
>>
> 
> Hi Simon,
> 
> Once I put all of what I think are the right steps back in place, I get:
> 
> Exception in thread "main" org.osoa.sca.ServiceRuntimeException: 
> org.apache.axis2.AxisFault: The system cannot infer the transport 
> information from the / URL.
> 
> I saw reference to this in the mailing lists I think sometime last year 
> and didn't see a resolution. I'm very happy to post the entire project 
> (either here or JIRA) - but would of course certainly rather figure it 
> out for myself.
> 
> Thanks very much
> Ray
> 
> 
> 
I should add that the above error seems independent of the WSDL itself - 
i.e. I get the same error with/without the WSDL being in the path.


Mime
View raw message