Venkata Krishnan wrote:
Ant / Jean
Thanks for the inputs.  For now I have started to lookup the existing
WSDL2Java implementation to get a feel of the sort of wrapping up that has
been done over Axis.  I do have Axis2 downloaded a week ago and I do find
the tooling classes in it.  However, it seems that this is not a part of the
build yet since the Axis2 binary listing did not have these classes.
Anyways let me download the more recent stuff and confirm this.  Also will
try out the tools.

Meanwhile a quick question on your point on picking up annotations.  In this
specific case why is that we need to pick up the interface name from the
annotation.  Can't we expect that to be a direct input to the tool instead
of the implementation class name?
I think that the name mapping needs to be recorded somewhere, for a number of reasons:

- The runtime will probably need to find the WSDL corresponding to a Java interface (to publish the WSDL for example) and the Java interface corresponding to a WSDL (to dispatch to Java methods corresponding to the operations).

- There are a number of scenarios where you'll want to round-trip between WSDL and Java. For example if you start from WSDL, generate a java interface, then in a different context generate a WSDL again, you'll probably want the generated WSDL to have the same name as the original one (or detect that you don't need to generate a new WSDL because you already have it).

- IMO passing the WSDL name to Java name mapping to the tool each time you want to generate a WSDL is not very convenient, specially if want to automate the code generation, or generate batches of WSDLs (on *.java for example). The less questions you ask in the tool the better. I think it's simpler for the application developer to just edit his Java classes, WSDLs and XSDs and annotate them, then run the code generator tools without having to pass too many options.

- Specifying the XML name to Java name mapping once in the WSDL, XSD or the Java aritfact allows multiple tools to use the same mapping. For example application developers annotate XSD types with sdo:name attributes that tell our XSD2Java tool the Java type names to generate. This allows WSDL2Java to use to same XSD name to Java name mapping as well when generating Java methods that flow these types. If the user just passed the name mappings as options to our XSD2Java tool, then WSDL2Java would not know about the mappings and would not generate the correct Java methods. Another option would be for the user to pass the same XSD name to Java name mappings again to WSDL2Java, but to do that he would have to look at his WSDL and XSD files very carefully and figure out the complete list of XSDs. This is starting to get really too complicated...

The SDO spec already defines XSD annotations to address these issues. I think we need to do something similar and define annotations for WSDL and Java interfaces (including service interfaces and SDO data object interfaces).

- Krish

On 3/24/06, ant elder <[EMAIL PROTECTED]> wrote:
Oh, one more thing as I don't know how  familiar you are with Axis2.

Java2WSDL has only recently been added to Axis2. There's been some code
there for a while but not finished. I think the first release officially
supporting it is 0.95 which was only released yesterday. If you look in
the
0.95 release there still isn't a Java2WSDL.bat file, maybe that was an
oversight. It seems to work copying wsdl2java.bat to java2wsdl.bat and
then
changing the 3rd to last line to end in Java2WSDL instead of WSDL2Java.

   ...ant

On 3/24/06, ant elder <[EMAIL PROTECTED]> wrote:
I've added a comment to the JIRA saying that you're looking at this. If
you get yourself a JIRA id (http://issues.apache.org/jira) you'll be
able
to add comments to the JIRA with any progress as you go along (but its
fine
to have discussion about it on the mailing list).

Jean-Sebastien said he'd tell you more about whats been already been
done
for WSDL2Java so I'll leave that to him, but fyi here's a post he did
describing it:

http://mail-archives.apache.org/mod_mbox/ws-tuscany-dev/200603.mbox/[EMAIL 
PROTECTED]
Have a look at the tuscany-sca-tools and tuscany-sca-plugin projects.
Where ever they have something about wsdl2java you probably need to look
at
adding something for java2wsdl.

I'd start with trying something simple - It could well be that the Axis2
Java2WSDL does most of what we need, so what you'll be adding will be
simple
wrappers that delegate to it. If you run it against our helloworld
sample
class the resulting wsdl should look something like the wsdl we use for
that:


http://svn.apache.org/repos/asf/incubator/tuscany/java/samples/helloworld/helloworldws/src/main/java/org/apache/tuscany/samples/helloworldws/HelloWorldServiceComponentImpl.java
http://svn.apache.org/repos/asf/incubator/tuscany/java/samples/helloworld/helloworldws/src/main/resources/wsdl/helloworld.wsdl
Our Java2WSDL needs to take into account the SCA annotations. That
HelloWorldServiceComponentImpl.java has the annotation @Service(
HelloWorldService.class). So that interface is what Java2WSDL should use
to get the operations in the WSDL, so you need to find a way to hook
into
the Axis2 Java2WSDL to add code to pick up the annotation.

   ...ant


On 3/23/06, Jean-Sebastien Delfino <[EMAIL PROTECTED]> wrote:
Venkata Krishnan wrote:
Hello Everybody,
    I would like to contribute to Tuscany Java implementation
(runtime
and
tools).  To start with I would like to help with some Tool
Development.
Looking up the Jira I found an item "Add Java2WSDL Tools" - (
https://issues.apache.org/jira/browse/TUSCANY-103) in the context of
Java
SCA Axis Integration .  Could we do something here?   What are the
requirements of this tool over and above the Java2WSDLTool being
done
in
Axis2.   Could somebody provide pointers to this, please.  Thanks.

Regards
S Venkatakrishnan


Hi Venkata,

Welcome on board, we're definitely looking for help in that space. I
can
try to give you an idea of the requirements I can think of.

We basically have two use cases for Java2WSDL:
(A) I'm an application developer and I'm building an SCA application
out
of multiple components. In some of my components (e.g. POJO
components)
I'll want to use Java interfaces, in some other components (let's
imagine BPEL or XSLT or other XML-ish component types), I'll want to
use
WSDL portTypes instead, on my SCA entryPoints and externalServices,
I'll
probably prefer to use WSDL portTypes as well because it'll be easier
to
communicate the service contracts to other people this way. To be able
to use a mix of Java interfaces and WSDL portTypes in my application,
I'll need to  be able  to generate WSDL -> Java and Java -> WSDL, at
development time. I guess I'll need command line tools, and/or Maven
plugins to help me do that.

(B) I'm a Java developer, and I don't have any idea what WSDL is
about.
I've built an application out of POJO components, using only Java
interfaces. I want to expose one of the services implemented by a POJO
component as a Web Service. To do this, I'm going to create an SCA
entryPoint with a Web Service binding, but here again I'm just going
to
declare a Java interface - since again I have no idea what WSDL is
about
and I don't actually care about it :). At some point I'll still need a
WSDL portType + binding + service to be generated to publish my Web
Service, so that consumers can get their hands on it and talk to it.
For
this, we need to generate WSDL at deployment time maybe or even better
at runtime.

Hope this helps understand what we're trying to do. We've done some
initial work to integrate the Axis2 WSDL2Java tool (but the
integration
is still rough and needs more work, so if you want you can also take a
look at that as well), and we have nothing yet for Java2WSDL.

Now how is that different from the Axis2 Java2WSDL? I'm not sure...
the
closer the better I guess, it'll be interesting to see how their
Java2WSDL can be integrated and customized. I'm anticipating a few
differences as we have to consider multiple databindings including
SDO,
our interfaces are also annotated with SCA specific annotations that
may
impact what the generated WSDL will look like.

I'm sure this will trigger many more questions, and we'll probably
discover the answers as we go :) Please don't hesitate to ask on this
list. I'll also send a few pointers to what we've already done for
WSDL2Java later today.

--
Jean-Sebastien





--
Jean-Sebastien

Reply via email to