[ 
http://issues.apache.org/jira/browse/TUSCANY-686?page=comments#action_12432666 
] 
            
Scott Kurz commented on TUSCANY-686:
------------------------------------

A few points I'd like to add to the discussion here:

First,

1) It could be that it's best to consider it to be the binding's (e.g. the 
Axis2 WS binding's) responsibility to generate a Java interface class from the 
WSDLServiceContract if it needs one.    I was hoping this JIRA would provoke 
this discussion in case my assumption that InterfaceWSDLLoader should generate 
the Java intf class was incorrect.

Next,

I went ahead and ported some code in the old 
WSDLServiceContractImpl.generateJavaInterface() method to use ASM to generate 
the intf.         
(I won't post the patch unless it turns out I'm on the right track here)

I hit two problems:

2) I had to hack CompositeClassLoader to allow me to do a defineClass with the 
generated Java class.  (Not 100% sure this is needed but I'm guessing it might 
be since it was present in M1 and before)

3) The ConnectorImpl check for interface compatibility is too strict. 

When, in method, ConnectorImpl .connect(SCAObject<T> source,   OutboundWire<T> 
sourceWire) we do:

           Class sourceInterface = 
sourceWire.getServiceContract().getInterfaceClass();
            Class targetInterface = 
targetWire.getServiceContract().getInterfaceClass();
            if (!sourceInterface.isAssignableFrom(targetInterface)) {
                throw new BuilderConfigException("Incompatible source and 
target interfaces");
            }

this says that two classes w/ compatible methods (per SCA spec) are disallowed 
since they are not part of the same inheritance hieararchy.   

However, if, on the one side, I have a generated Java class from a WSDL->Java 
and on the other side a compatible (per SCA spec)
interface corresponding to the Java interface packaged along w/ my component w/ 
Java implementation....then this should be allowed by the Connector.



> InterfaceWSDLLoader creates WSDLServiceContract objs which return null on 
> getInterfaceClass()
> ---------------------------------------------------------------------------------------------
>
>                 Key: TUSCANY-686
>                 URL: http://issues.apache.org/jira/browse/TUSCANY-686
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SCA Core
>    Affects Versions: Java-M2
>         Environment: r438923
>            Reporter: Scott Kurz
>
> SYMPTOM (when using <interface.wsdl> elem along with <binding.ws> and Axis 2 
> binding:
> java.lang.NullPointerException
>       at 
> org.apache.tuscany.core.builder.ConnectorImpl.connect(ConnectorImpl.java:314)
>       at 
> org.apache.tuscany.core.builder.ConnectorImpl.connect(ConnectorImpl.java:110)
>       at 
> org.apache.tuscany.core.builder.ConnectorImpl.connect(ConnectorImpl.java:91)
>       at 
> org.apache.tuscany.core.deployer.DeployerImpl.connect(DeployerImpl.java:141)
>       at 
> org.apache.tuscany.core.deployer.DeployerImpl.deploy(DeployerImpl.java:103)
>       at 
> org.apache.tuscany.core.launcher.LauncherImpl.bootApplication(LauncherImpl.java:193)
> PROBLEM:
> Axis2BindingBuilder.build does (line 60):
>        Class<?> interfaze = 
> serviceDefinition.getServiceContract().getInterfaceClass();
> This simply returns null since the WSDLServiceContract built by 
> InterfaceWSDLLoader contains a portType but no interface class.    Thus the 
> ConnectorImpl hits the NPE we see above.
> Some sort of WSDL2Java should probably? be done when InterfaceWSDLLoader sets 
> the portType on the WSDLServiceContract it builds.

-- 
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

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to