-----Original Message-----
From: Simon Laws [mailto:[email protected]] 
Sent: 18 May 2010 12:56
To: [email protected]
Subject: Re: Problem calling to an external web service.

On Tue, May 18, 2010 at 12:25 PM, Gregor Kiddie
<[email protected]> wrote:
> I'm trying to make a call from Tuscany to an external webservice. I think I
> have it set up correctly, but it gives the same error each time. It's
> running in a Tomcat Container.
>
>
>
> The error I'm getting is
>
>
>
> Caused by: org.osoa.sca.ServiceRuntimeException: No runtime wire is
> available
>
>                 at
> org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:186)
>
> and my composite looks like this
>
>
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <composite xmlns="http://www.osoa.org/xmlns/sca/1.0";
>
>             targetNamespace="com.mycompany.myproduct.mymodule"
>
>             name="mymodule">
>
>
>
>       <component name="MyModule">
>
>             <implementation.spring
> location="WEB-INF/classes/applicationContext.xml" />
>
>             <service name="MyService">
>
>                   <binding.ws />
>
>             </service>
>
>       </component>
>
>
>
>       <reference name="myServiceProvider">
>
>             <interface.java
> interface="com.mycompany.soa.webservices.SuperServiceSkeletonInterface" />
>
>             <binding.ws
> uri="http://soa.0002.dev.mycompany.com/SuperFacility/SuperService.asmx"; />
>
>       </reference>
>
> </composite>
>
>
>
> Any suggestions?

Hi

Try putting the reference inside the component, for example,

      <component name="MyModule">
            <implementation.spring
location="WEB-INF/classes/applicationContext.xml" />
            <service name="MyService">
                  <binding.ws />
            </service>
           <reference name="myServiceProvider">
                <interface.java
interface="com.mycompany.soa.webservices.SuperServiceSkeletonInterface"
/>
                <binding.ws
uri="http://soa.0002.dev.mycompany.com/SuperFacility/SuperService.asmx";
/>
           </reference>
      </component>

I'm assuming that you're Spring context defines a reference property
called "myServiceProvider". You can of course put references at the
composite level but they should refer to a component reference that
they promote using the the "promote" attribute.

Regards

Simon

Yeah, the applicationContext looks like this

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans";
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
       xmlns:sca="http://www.springframework.org/schema/sca";
       xsi:schemaLocation="
           http://www.springframework.org/schema/beans
           http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
           http://www.springframework.org/schema/sca
           http://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd";>
        
        <bean id="MyModuleBean" 
class="com.mycompany.myproduct.mymodule.impl.DefaultImplementation">
                <property name="myServiceProvider" ref="myServiceProvider" />
        </bean>
</beans>

Putting the reference in the component and removing the property set in the 
applicationContext throws an error on start up

Caused by: org.apache.tuscany.sca.monitor.MonitorRuntimeException: Reference 
not found for component reference: Component = MyModule Reference = 
myServiceProvider


-- 
Apache Tuscany committer: tuscany.apache.org
Co-author of a book about Tuscany and SCA: tuscanyinaction.com

Reply via email to