|
[
Permlink
| « Hide
]
Raymond Feng added a comment - 14/Apr/06 02:12 PM
I debugged the problem and found out the target invoker is set only if there's a reference pointing to the WS-externalService. The logic to configure target handler is in ExternalWebserviceWireBuilder. In my test case, I call moduleContext.locateService("InteropDocTest") directly instead of going through the reference.
Here's the zip containing the WS external service and entry point projects for the InteropDocTest. I didn't have a chance to test
the entry point. This was tagentially related to
org.apache.tuscany.container.java.integration.binding.EPtoExternalServiceTestCase org.apache.tuscany.container.java.integration.binding.ExternalServiceProxyInvokeTestCase Again, if this doesn't fix the problem, can you send a testcase demonstrating the issue so I can help address it? To get the test case build, you need to run "mvn clean install eclipse:eclipse" against the root folder of the "interopdoc". It's a maven project.
This is not fixed. The original issue i think may have been but this exposes another problem so the ModuleContext locateService still fails.
The problem now appears to be that the object return by locateService does not implement the expected Java interface. The externalService is using interface.wsdl so tuscany generates a Java interface class to represent the WSDL portType. Thats the interface that the proxy returned to the client is implementing but its not the same as the interface the client is expecting so the client gets a class cast exception. I guess what should happen is something like before generating the interface for the WSDL portType it should check if the client has available a class of that name and if so use that instead of generating one. This is the same issue we were discussing on IRC the other day with using interface.wsdl in a .componentType side file. Can't remember if there's a JIRA for that, I'll go check and if so link these JIRAs together. The original description describes how to recreate the problem, if thats not clear enough here's the patch to make the required change: Index: C:/SCA/SVN/RN9/samples/helloworld/helloworldwsclient/src/main/java/org/apache/tuscany/samples/helloworldwsclient/HelloWorldClient.java =================================================================== --- C:/SCA/SVN/RN9/samples/helloworld/helloworldwsclient/src/main/java/org/apache/tuscany/samples/helloworldwsclient/HelloWorldClient.java (revision 396794) +++ C:/SCA/SVN/RN9/samples/helloworld/helloworldwsclient/src/main/java/org/apache/tuscany/samples/helloworldwsclient/HelloWorldClient.java (working copy) @@ -39,7 +39,7 @@ ModuleContext moduleContext = CurrentModuleContext.getContext(); // Locate the HelloWorld service component and invoke it - HelloWorldService helloworldService = (HelloWorldService) moduleContext.locateService("HelloWorldServiceComponent"); + HelloWorldService helloworldService = (HelloWorldService) moduleContext.locateService("HelloWorldService"); String value = helloworldService.getGreetings("World"); An alternative may be to change the externalSevrice to use interface.java instead of interface.wsdl however that results in the infinate loop in AbstractJavaComponentInvoker that was reported in
The related JIRA about using interface.wsdl in .componentType side files is
Closing this since original problem is fixed, and we can work on
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||