Please see my comments inline. Thanks, Raymond
-------------------------------------------------- From: "Simon Nash" <[EMAIL PROTECTED]> Sent: Wednesday, April 02, 2008 7:31 AM To: "tuscany-dev" <tuscany-dev@ws.apache.org> Subject: JAX-WS support in the Java to WSDL mapping (TUSCANY-2033)
I'd like to restart the discussion on supporting JAX-WS annotations for the Java-to-WSDL mapping. This is needed to fix TUSCANY-2033, and has been the subject of various user requests from time to time. The scenario that I want to fix is a service with a Java interface that was generated from WSDL by running the JAX-WS mapping (e.g., the wsimport tool from the JAX-WS RI). The generated service interface and associated classes (e.g., exceptions, data objects) will have JAX-WS and JAXB annotations that are equivalent to the information contained in the WSDL.
I have prototyped a demo application for the weather forecast web service as you described. It runs successfully
with the trunk code. I can check it in as an sample.
The runtime processing for a Tuscany client talking to a Tuscany service is as follows: a. (client and service) Generate an equivalent WSDL interface from the Java service interface and associated classes. b. (client and service) Generate equivalent XSD types from the Java service interface and associated classes. c. (client and service) Use the Web Service stack to create a service definition from the output of a and b. This is done by the Web Service binding. d. (client) Transform the Java datatypes passed on the service invocation into an XML infoset (as defined by b) for marshalling by the reference binding's Web Service stack. This is done by the databinding framework. In Tuscany today, the XML infoset would be AXIOM for use by the Axis2 binding. e. (client) Pass the XML infoset created by d to the service definition created by c. This is done by the Web Service binding. f. (service) Receive the invocation data in XML infoset form from the service definition created by c. This is done by the Web Service binding. g. (service) Transform the XML infoset (as defined by b) passed on the service invocation into Java classes that can be passed to the service business logic. This is done by the databinding framework. h. (service) Invoke the service business logic. i. Any result or exception is returned to the client using the inverse of steps d to g.
Good summary.
My understanding is that the current state of the Tuscany code for these steps is as follows. a. Broken, does not understand JAX-WS annotations.
Not really. We support most of the JAX-WS annotations for java SEI (Service Endpoint Interface) in interface-java-jaxws module.
b. Most or all of the code needed is currently present in the JAXP transformer and the exception mapper, but some information that it needs (derived from JAX-WS annotations) is not being passed to it.
I assume you meant JAXB. What information is missing?
c. Would probably work if the right outputs from a and b were passed in, but this is not certain as it depends on whether the Axis2 stack that we are using has any limitations here. d. Probably working if the correct output from b is available. e. Probably working. f. Probably working. g. Probably working if the correct output from b is available. h. Working. i. Probably working once the above steps have been made to work. Tuscany also has standalone tools to do Java-to-WSDL and WSDL-to-Java mapping. These currently use code that's completely separate from the above code in the runtime. Ideally as much code as possible should be shared between tools and runtime. Specifically, the code for steps a and b should also be invoked by the tools, to guarantee consistent processing. This means that we need a module structure that makes it easy for the tools to pull in this code without too many other dependencies.
+1.
For databindings other than JAXB (let's use SDO as an example), steps b, d and g need to be pluggable. Currently only steps d and g are pluggable, so b needs to include a framework that allows other databinding transformations to be plugged in.
Right.
For WSDL to Java processing, something similar is needed, but I won't make this post twice as long by spelling out all the steps here. In terms of making progress on TUSCANY-2033 and similar use cases, I think the the starting point is to work on steps a and b and at least get them into an 80% state so that we can start to run end-to-end scenarios through all the steps. We could then go back later and get them to a state of 100% perfection. I have been thinking of having the Tuscany runtime call code in CXF to do the 80% exercise for step a, perhaps only as a temporary prototype and learning exercise until we have all the necessary code in Tuscany. I think I understand how to do this, but I don't yet feel able to do a "from scratch" implementation of step a.
I have checked in some code to demonstrate how we can generate WSDL portType out of our Interface/Operation model. @ https://svn.apache.org/repos/asf/incubator/tuscany/java/sca/modules/interface-wsdl-java2wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/interface2wsdl. Please note I name it as Interface2WSDL.
It seems that step a is not so complicated even though my initial code needs more enhancements. For step b, I have added the capability into databinding-jaxb module to generate XSD from JAXBContext. We can do the similar thing for SDO and there are APIs for it.
I'd welcome other thoughts on this and any offers to help with steps a or b. Simon --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]