I always do both -- if I set minOccurs="0" I also set nillable. They're not the 
same thing, but my clients (few of which I have any control over) don't seem to 
distinguish between the two. Between the two flags, Axis seems to handle 
everything thrown at it: I just have to be a little careful on the server end.

Chris
 

-----Original Message-----
From: Jalenak, Jerry [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, November 15, 2005 06:04
To: [email protected]; [EMAIL PROTECTED]
Subject: RE: Forcing nillable=true with Document Literal Wrapped

Thanks to Anne and Davanum for the replies.  We've decided to follow dims 
recommendation and commit the WSDL to CVS, and manually edit any future changes.

 

Anne - I tried your suggestion of using minOccurs="0" rather than 
nillable="true".  When the client passes in a null for the value however, I 
still get the message from the BeanSerializer that the variable is not marked 
as 'nillable' - 

 

  if (propValue == null) {

    throw new IOException(

        Messages.getMessage(

          "nullNonNillableElement",

          propName));

  }

 

I switched back to using nillable="true" for now.  Is this an issue that others 
have come across?

 

Thanks again.

 

Jerry Jalenak

Software Engineer

Netopia, Inc.

________________________________

From: Anne Thomas Manes [mailto:[EMAIL PROTECTED]
Sent: Sunday, November 13, 2005 6:10 AM
To: [email protected]; [EMAIL PROTECTED]
Subject: Re: Forcing nillable=true with Document Literal Wrapped

 

I suggest you use minOccurs="0" rather than nillable="true".
.NET is a little tempermental about nil.

Anne

On 11/12/05, Davanum Srinivas <[EMAIL PROTECTED]> wrote:

Jerry,

recommendation is to use Java2WSDL once, use the wsdl as a starting point, 
check it into your cvs/svn repo. Make any modifications if necessary 
incrementally and use the WSDL2Java on the wsdl. (In other words, Don't keep 
regenerating the wsdl from Java2WSDL). Basically you should use Java2WSDL as a 
bootstrap thing to get something quick and dirty and from then on stick to the 
WSDL.

-- dims

On 11/10/05, Jalenak, Jerry < [EMAIL PROTECTED]> wrote:
> Thanks for the reply.  I guess I'm not clear on how to code up an 
> 'extra' class for this purpose.  The 'generated' classes are coming 
> from the method signatures of my class - i.e., if I have
>
>    public String getAbc(ComplexObject1 co1, ComplexObject2 co2) { .... 
> }
>
> I get a new class called GetAbc.java which looks like this -
>
>    public class GetAbc implements java.io.Serializable {
>       private ComplexObject1 in0;
>       private ComplexObject2 in1;
>
>       public GetAbc() {}
>       public GetAbc(ComplexObject1 in0, ComplexObject2 in1) {
>          this.in0 = in0;
>          this.in1 = in1;
>       }
>
>       .... a bunch of other methods ....
>    }
>
> And in the WSDL I get
>
>    <element name="getAbc"> 
>       <complexType>
>          <sequence>
>             <element name="in0" type="impl:ComplexObject1"/>
>             <element name="in1" type="impl:ComplexObject2"/>
>          </sequence>
>       </complexType>
>     </element>
>
> All I need to be able to do is add 'nillable="true"' to the <element />s 
> above.  It would be nice if, instead of apply this to everything, that I 
> could specify some sort of attribute so I could control which method 
> attributes get the 'nillable="true"' option.
>
> Thanks.
>
> Jerry Jalenak
> Software Engineer
> Netopia, Inc.
> -----Original Message-----
> From: BASNARY Olivier [mailto: [EMAIL PROTECTED]
> Sent: Thursday, November 10, 2005 4:37 PM
> To: [email protected]
> Subject: RE: Forcing nillable=true with Document Literal Wrapped
>
> I depends a lot on which parameters you ar using with java2WSDL.
>
> You should check for extraclasses parameter.
>
> For instance, I use ant task with these params :
> <target name="java2wsdl"> 
>     <axis-java2wsdl classname="${appClassName}"
> classpath="${build.dir}" // this is very important
>                 methods=<My service operations>                         
> extraClasses
> ="${appExtraclass}" // Beans describing complex types 
> output="${appOutputWSDL}" // Name of output WSDL 
> location="${appLocation}" // Service URL : http://...
> namespace="${appNamespace}" //
> namespaceImpl="${appNamespaceImpl}" //urn:..
> style="WRAPPED"/>
> </target>
>
> And all my attributes are nillable='true'. 
>
> You should check in Axis ejb samples for a build.xml containing a j2w 
> ant task and change it to your convenience (by adding style 
> parameter).
>
> --- "Jalenak, Jerry" < [EMAIL PROTECTED]> a écrit :
>
> > I'm wrapping an existing class and exposing it as a Document Literal 
> > Wrapped webservice.  When I generate the WSDL with Java2WSDL, the 
> > generated WSDL contains 'created' class definitions for the new 
> > object that 'wraps' my input attributes.  Is there a way to force 
> > 'nillable=true' to be added to these definitions?
> >
> >
> >
> > i.e., I get this -
> >
> >
> >
> >    <element name="replaceCPE">
> >
> >     <complexType>
> >
> >      <sequence>
> >
> >       <element name="in0"
> > type="impl:CpeIdentifier"/>
> >
> >       <element name="in1" 
> > type="impl:CpeProperties"/>
> >
> >       <element name="in2" type="impl:EventSink"/>
> >
> >      </sequence>
> >
> >     </complexType>
> >
> >    </element>
> >
> >
> >
> > But I want this -
> >
> >
> >
> >    <element name="replaceCPE">
> >
> >     <complexType>
> >
> >      <sequence>
> >
> >       <element name="in0" nillable="true"
> > type="impl:CpeIdentifier"/>
> >
> >       <element name="in1" nillable="true"
> > type="impl:CpeProperties"/>
> >
> >       <element name="in2" nillable="true" 
> > type="impl:EventSink"/>
> >
> >      </sequence>
> >
> >     </complexType>
> >
> >    </element>
> >
> > 
> >
> > Thanks!
> >
> >
> >
> > Jerry Jalenak
> >
> > Software Engineer
> >
> > Netopia, Inc.
> >
> >
> > 
> >
>
>
>
>
>
>
>
> ______________________________________________________________________
> _____ Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! 
> Messenger Téléchargez cette version sur http://fr.messenger.yahoo.com
>


--
Davanum Srinivas : http://wso2.com/blogs/

 

Reply via email to