Resending as my first attempt was bounced by the list.
Simon
-------- Original Message --------
Subject: Re: Java2WSDL output for no parameters or void return type?
Date: Wed, 12 Sep 2007 11:04:44 +0100
From: Simon Nash <[EMAIL PROTECTED]>
Organization: IBM
To: [EMAIL PROTECTED]
CC: axis-dev@ws.apache.org
References: <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> <[EMAIL PROTECTED]>
I am not quite clear about the intended changes in the Axis2 generator
in the future. There were two different cases described, with only
one answer. Please see my comments inline.
Simon (Nash)
Simon Laws wrote:
Thanks for the reply Deepal. So we can assume that in some future version of
Axis2 running java2wsdl on the method
public String foo();
Will give rise to the types
+ <xs:element name="foo">
+ <xs:complexType/>
+ </xs:element>
<xs:element name="fooResponse">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="return"
nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
If we know this is the intention we can code accordingly in Tuscany, i.e.
potentially post process the WSDL definition for now to add in the missing
type.
This would resolve the first question about a method for an in-out MEP that
has no parameters.
Regards
Simon
On 9/12/07, Deepal Jayasinghe <[EMAIL PROTECTED]> wrote:
On 9/12/07, Simon Laws <[EMAIL PROTECTED]> wrote:
Hi
I asked this question on the user list but would like to move it along
and ask the developer communities opinion....
In the Apache Tuscany Incubator we are using the Axis2 Java2WSDL
tooling. We generate document/literal/wrapped wsdl (the default I believe
for java2WSDL) and in Tuscany we are using the JAX-WS V2 specification as a
guide to what constitutes wrapped WSDL. We are coming up to our 1.0release (in
a few weeks time) and have run into a couple of issues where we
need to decide quickly whether we are using the Axis2 tools incorrectly or
whether we need to implement a work around.
Note. We are running with Axis2 1.2 in Tuscany currently but I did the
generation below with Axis2 1.3 just to see if anything had changed in
the latest version.
For the interface:
public interface TestServiceParam {
public String foo();
}
Axis1.3 Java2WSDL produces
...
<wsdl:types>
<xs:schema xmlns:ns=" http://test"
attributeFormDefault="qualified" elementFormDefault="qualified"
targetNamespace=" http://test">
<xs:element name="fooResponse">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="return"
nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
</wsdl:types>
<wsdl:message name="fooRequest"/>
<wsdl:message name="fooResponse">
<wsdl:part name="parameters" element="ns0:fooResponse"/>
</wsdl:message>
<wsdl:portType name="TestServiceParamPortType">
<wsdl:operation name="foo">
<wsdl:input message="ns0:fooRequest" wsaw:Action="urn:foo"/>
<wsdl:output message="ns0:fooResponse"
wsaw:Action="urn:fooResponse"/>
</wsdl:operation>
</wsdl:portType>
...
I was expecting the following. I've added + to the lines that have been
added.
...
<wsdl:types>
<xs:schema xmlns:ns=" http://test"
attributeFormDefault="qualified" elementFormDefault="qualified"
targetNamespace=" http://test">
+ <xs:element name="foo">
+ <xs:complexType/>
+ </xs:element>
<xs:element name="fooResponse">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="return"
nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
</wsdl:types>
<wsdl:message name="fooRequest">
+ <wsdl:part name="parameters" element="ns0:foo"/>
</wsdl:message>
<wsdl:message name="fooResponse">
<wsdl:part name="parameters" element="ns0:fooResponse"/>
</wsdl:message>
<wsdl:portType name="TestServiceParamPortType">
<wsdl:operation name="foo">
<wsdl:input message="ns0:fooRequest" wsaw:Action="urn:foo"/>
<wsdl:output message="ns0:fooResponse"
wsaw:Action="urn:fooResponse"/>
</wsdl:operation>
</wsdl:portType>
...
Is the current output produced by design and if so why is it this way?
Are there options I can use to make java2WSDL generate the form I would
like?
For the interface
public interface TestServiceReturn {
public void foo(String param);
}
Axis1.3 Java2WSDL produces
<wsdl:types>
<xs:schema xmlns:ns=" http://test"
attributeFormDefault="qualified" elementFormDefault="qualified"
targetNamespace=" http://test">
<xs:element name="foo">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="param0"
nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
</wsdl:types>
<wsdl:message name="fooRequest">
<wsdl:part name="parameters" element="ns0:foo"/>
</wsdl:message>
<wsdl:portType name="TestServiceReturnPortType">
<wsdl:operation name="foo">
<wsdl:input message="ns0:fooRequest" wsaw:Action="urn:foo"/>
</wsdl:operation>
</wsdl:portType>
How did Axis2 decide to produce a one way message here?
Is there a way I can ask java2WSDL to produce a 2 way message in this
situation?
Its not one way , it is in-out MEP, but it does not take any method
parameters. So we do need to generate separate Schema element for foo.
I'm not quite sure whether this in answering the question about
public String foo();
or the other question about
public void foo(String param);
I think it's answering the former. If I have understood this correctly,
then I'm not clear about what is the intention of Axis2 for the latter.
This case does seem to generate an in-only MEP at the moment. Will it be
possible to create an in-out MEP for this case if the user wants this?
I've looked in the mail lists and in JIRA and I don't see mention of this
but I'm fairly new to the resources that Axis2 has to offer so there's a
good chance I'm not looking in the right place or with the right search
term. Apologies if it's staring me in the face.
Thanks
Simon Laws
Apache Tuscany Incubator
--
============================
Deepal Jayasinghe
Lanka Software Foundation
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]