Hi all,

Its my first time dealing with groovy and Ive been assigned to reproduce in 
groovy an example (100% working in pure java)  wich involves reference to an 
external ws and a component with its implementation in groovy but it doesnt 
work :( Im using the tuscany java 1.6

The several files in the example are given next:

SCA Composite file

<composite xmlns="http://www.osoa.org/xmlns/sca/1.0";
        xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0";
        targetNamespace="http://www.mathertel.de/OrteLookupSample"; 
name="ortelookup">
        <component name="OrtelookupServiceComponent">
                <tuscany:implementation.script 
script="ortelookup/groovy/OrtelookupServiceComponent.groovy" />
                <reference name="orteLookupSoap">
                         <interface.java 
interface="ortelookup.groovy.OrteLookupSoap"/>
                        <binding.ws
                                
wsdlElement="http://www.mathertel.de/OrteLookup/#wsdl.port(OrteLookup/OrteLookupSoap)"
                                
uri="http://mathertel.de/AJAXEngine/S02_AJAXCoreSamples/OrteLookup.asmx"; />
                </reference>
        </component>
</composite>

Inteface like this:

@Remotable
@WebService(name = "orteLookupSoap", targetNamespace = 
"http://www.mathertel.de/OrteLookup/";)
public interface OrteLookupSoap {

    @WebMethod(operationName = "OrteStartWith", action = 
"http://www.mathertel.de/OrteLookup/OrteStartWith";)
     public String orteStartWith(String prefix);

    @WebMethod(operationName = "GetPrefixedEntries", action = 
"http://www.mathertel.de/OrteLookup/GetPrefixedEntries";)
     public String getPrefixedEntries(String prefix);

}

Component implementation in groovy :

package ortelookup.groovy;


import org.osoa.sca.annotations.Reference;
import org.osoa.sca.annotations.Service;

@Service(OrteLookupSoap.class)
public class OrtelookupServiceComponent implements OrteLookupSoap {
        @Reference(name="orteLookupSoap", required=true)
        OrteLookupSoap orteLookupSoap;

        public OrteLookupSoap getOrteLookupSoap() {
        System.out.println("Got Injected OrteLookupSoap");
                return orteLookupSoap;
        }

        public void setOrteLookupSoap(OrteLookupSoap orteLookupSoap) {
        System.out.println("Injected OrteLookupSoap");
                this.orteLookupSoap = orteLookupSoap;
        }

        public String getPrefixedEntries(String prefix) {
                // TODO Auto-generated method stub
                return orteLookupSoap.getPrefixedEntries(prefix);
        }

        public String orteStartWith(String prefix) {
                // TODO Auto-generated method stub
                return orteLookupSoap.orteStartWith(prefix);
        }
}

And the Java SCA client

        public static final void main(String[] args) throws Exception {

                SCADomain scaDomain = 
SCADomain.newInstance("ortelookup.composite");
                OrteLookupSoap lookupService 
=(OrteLookupSoap)scaDomain.getService(OrteLookupSoap.class, 
"OrtelookupServiceComponent");
                String  value = lookupService.orteStartWith("b");
                System.out.println (value);
                scaDomain.close();

        }

The result is a beautiful exception saying:

Caused by: java.lang.NoSuchMethodException: No signature of method: 
org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.OrteStartWith() is applicable 
for argument types: (java.lang.String) values: [b]
        at 
org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.invokeImpl(GroovyScriptEngineImpl.java:358)
        at 
org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.invokeFunction(GroovyScriptEngineImpl.java:159)
        at 
org.apache.tuscany.sca.implementation.script.ScriptInvoker.doInvoke(ScriptInvoker.java:60)
        at 
org.apache.tuscany.sca.implementation.script.ScriptInvoker.invoke(ScriptInvoker.java:76)
        at 
org.apache.tuscany.sca.extension.helper.impl.ImplementationImplementationProvider$InvokerProxy.invoke(ImplementationImplementationProvider.java:90)
        at 
org.apache.tuscany.sca.core.databinding.wire.PassByValueInterceptor.invoke(PassByValueInterceptor.java:60)
        at 
org.apache.tuscany.sca.binding.sca.impl.SCABindingInvoker.invoke(SCABindingInvoker.java:61)
        at 
org.apache.tuscany.sca.core.databinding.wire.PassByValueInterceptor.invoke(PassByValueInterceptor.java:60)
        at 
org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:349)
        at 
org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:193)
        ... 11 more

Please, any little suggestion will be appreciated


Reply via email to