Driver: apache-tuscany-sca-1.0.1-incubating-src
I am trying to invoke the live stock service that was used in older (m1 ans m2)
drivers. I have attached the WSDL file. I have tested this web service in Web
Services Explorer in RAD, and it works.
I am pasting code followed by the exception when I run it.
Stockquote.composite
<?xml version="1.0" encoding="UTF-8"?>
<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
xmlns:wsdli="http://www.w3.org/2006/01/wsdl-instance"
name="StockQuoteWS">
<component name="StockQuoteServiceComponent">
<implementation.java class="stockquote.StockQuoteServiceImpl"/>
</component>
<reference name="StockQuoteService"
promote="StockQuoteServiceComponent/stockQuoteService">
<interface.wsdl
interface="http://www.webserviceX.NET/#wsdl.interface(StockQuoteSoap)"
wsdli:wsdlLocation="http://www.webserviceX.NET/
wsdl/stockquote.wsdl" />
<binding.ws
endpoint="http://www.webserviceX.NET/#wsdl.endpoint(StockQuote/StockQuoteSoap)"
location="wsdl/stockquote.wsdl" />
</reference>
</composite>
StockQuoteServiceImpl.java:
public class StockQuoteServiceImpl implements StockQuoteService {
StockQuoteSoap stockQuoteService = null; // Injected by the SCA container.
@Constructor
public StockQuoteServiceImpl(@Reference(name = "stockQuoteService",
required = true)
StockQuoteSoap stockQuoteService) {
this.stockQuoteService = stockQuoteService;
}
/**
* @throws RemoteException
*/
public Map getQuotes(final String[] symbols) throws RemoteException {
try {
if (stockQuoteService == null)
System.out.println("stockQuoteService was not set by the SCA
runtime!");
....
....
StockClient.java that I am using to test:
public class StockClient {
public static void main(String[] args) throws Exception {
SCADomain scaDomain = SCADomain.newInstance("stockquote.composite");
StockQuoteService stockQuoteService =
scaDomain.getService(StockQuoteService.class,
"StockQuoteServiceComponent");
String[] stocks = {"IBM"};
System.out.println(stockQuoteService.getQuotes(stocks));
scaDomain.close();
}
}
The following is the exception I am getting running the client:
org.apache.tuscany.sca.databinding.TransformationException: Target fault type
cannot be resolved: class java.rmi.RemoteException
org.apache.axiom.om.OMElement Element: {http://stockquote/}RemoteException
Type: null
at
org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:126)
at
org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:233)
at
org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:130)
at $Proxy6.getQuote(Unknown Source)
at stockquote.StockQuoteServiceImpl.getQuotes(StockQuoteServiceImpl.java:64)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:615)
at
org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:105)
at
org.apache.tuscany.sca.core.databinding.wire.PassByValueInterceptor.invoke(PassByValueInterceptor.java:49)
at
org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:233)
at
org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:130)
at $Proxy5.getQuotes(Unknown Source)
at test.StockClient.main(StockClient.java:20)
Exception in thread "main" java.rmi.RemoteException:
org.apache.tuscany.sca.databinding.TransformationExceptionTarget fault type
cannot be resolved: class java.rmi.RemoteException
org.apache.axiom.om.OMElement Element: {http://stockquote/}RemoteException
Type: null; nested exception is:
org.apache.tuscany.sca.databinding.TransformationException: Target fault
type cannot be resolved: class java.rmi.RemoteException
org.apache.axiom.om.OMElement Element: {http://stockquote/}RemoteException
Type: null
at
stockquote.StockQuoteServiceImpl.getQuotes(StockQuoteServiceImpl.java:116)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:615)
at
org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:105)
at
org.apache.tuscany.sca.core.databinding.wire.PassByValueInterceptor.invoke(PassByValueInterceptor.java:49)
at
org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:233)
at
org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:130)
at $Proxy5.getQuotes(Unknown Source)
at test.StockClient.main(StockClient.java:20)
Caused by: org.apache.tuscany.sca.databinding.TransformationException: Target
fault type cannot be resolved: class java.rmi.RemoteException
org.apache.axiom.om.OMElement Element: {http://stockquote/}RemoteException
Type: null
at
org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:126)
at
org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:233)
at
org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:130)
at $Proxy6.getQuote(Unknown Source)
at stockquote.StockQuoteServiceImpl.getQuotes(StockQuoteServiceImpl.java:64)
... 10 more
Any thoughts?
Thanks
Mahi
"You must be the change you wish to see in the world" -- Mahatma Gandhi.
---------------------------------
Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]