You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Tom Jordahl <to...@macromedia.com> on 2004/10/05 01:40:58 UTC

Wrapped doc/lit WSDL generation

So I am attempting to switch Axis in to wrapped doc/lit mode with the
thought that my product could be WS-I compliant with its WSDL if I use Axis
1.2 and flip the switch from rpc/encoded.

It mostly works.

I was thinking about changing the WSDL generation (specifically
fromJava/Types.java - writeWrappedParameter()) to include the attributes
minoccurs=0 and maxoccurs=1:

            // Need to allow for nillable elements
            if (isNullable(javaType)) {
                childElem.setAttribute("minOccurs", "0");
                childElem.setAttribute("maxOccurs", "1");
            }

This would allow consumers of my service to omit parameters.  These
parameters would then get translated in to null values on the server end and
I could detect that.

Question: Do you think this is right?

Should there be a nillable=true attribute here instead?  Is that something
that you would expect/want to see in a document/literal WSDL?

WS-I doesn't say much about this one way or another.

What I *really* want is some way to include the 'omittable' attribute in my
Java service code, so I can signal to Axis that the WSDL should include this
parameter as optional (or not).  I can't think of a good way to do this,
without constructing a service description myself, which I can't do.

Your thoughts are appreciated.

--
Tom Jordahl
Macromedia Server Development


Re: Wrapped doc/lit WSDL generation

Posted by Nelson Minar <ne...@monkey.org>.
>Another point 
>a) Nillable is   <a></a> / vlaue does not present 
>b) minOcuurs="0" mean <a> might does not present at all.  

Does someone on the Axis team know which of these styles works best
with .NET? I've seen some trouble around this part of interop,
although I don't have a good example on hand.

Re: Wrapped doc/lit WSDL generation

Posted by Srinath Perera <he...@gmail.com>.
Hi Tom;
Just a thought .. I would have use maxOccur="" /minOccurs="" over
nillable (same way u have purposed) as that would be more Schema Like.
(Am not sure wether nillable allowed in doclitral, it is encoding I
belive).

Another point 
a) Nillable is   <a></a> / vlaue does not present 
b) minOcuurs="0" mean <a> might does not present at all.  

yes both Map in to the same thing in java. But are they both equivelent.

Thanks
Srinath


On Mon, 4 Oct 2004 19:40:58 -0400, Tom Jordahl <to...@macromedia.com> wrote:
> 
> So I am attempting to switch Axis in to wrapped doc/lit mode with the
> thought that my product could be WS-I compliant with its WSDL if I use Axis
> 1.2 and flip the switch from rpc/encoded.
> 
> It mostly works.
> 
> I was thinking about changing the WSDL generation (specifically
> fromJava/Types.java - writeWrappedParameter()) to include the attributes
> minoccurs=0 and maxoccurs=1:
> 
>            // Need to allow for nillable elements
>            if (isNullable(javaType)) {
>                childElem.setAttribute("minOccurs", "0");
>                childElem.setAttribute("maxOccurs", "1");
>            }
> 
> This would allow consumers of my service to omit parameters.  These
> parameters would then get translated in to null values on the server end and
> I could detect that.
> 
> Question: Do you think this is right?
> 
> Should there be a nillable=true attribute here instead?  Is that something
> that you would expect/want to see in a document/literal WSDL?
> 
> WS-I doesn't say much about this one way or another.
> 
> What I *really* want is some way to include the 'omittable' attribute in my
> Java service code, so I can signal to Axis that the WSDL should include this
> parameter as optional (or not).  I can't think of a good way to do this,
> without constructing a service description myself, which I can't do.
> 
> Your thoughts are appreciated.
> 
> --
> Tom Jordahl
> Macromedia Server Development
> 
>