[ 
http://issues.apache.org/jira/browse/TUSCANY-123?page=comments#action_12376212 
] 

ant elder commented on TUSCANY-123:
-----------------------------------

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");
 


> J2SE client using ModuleContext locateService for an externalService fails
> --------------------------------------------------------------------------
>
>          Key: TUSCANY-123
>          URL: http://issues.apache.org/jira/browse/TUSCANY-123
>      Project: Tuscany
>         Type: Bug

>   Components: Java SCA Core
>     Reporter: ant elder
>     Assignee: Jim Marino
>     Priority: Blocker
>  Attachments: interopdoc_testcases.zip
>
> A J2SE client using ModuleContext locateService for an externalService fails. 
> Try changing the HelloWorldClient in the helloworldwsclient sample to use the 
> externalService "HelloWorldService" in the moduleContext.locate call and it 
> fails. You get different errors depending on if the externalService uses 
> interface.java or interface.wsdl.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to