Thank you for your answer, Mike! We're using beehive for webservice development, and until now we tried to do as most as possible starting from java. If there's no way to tell java2wsdl to use minOccurs, it's probably the best to define the types using schema, to go partially the contract-first way.
Btw, the concrete problem that we had has to do with C# / .NET 1.1: if you send an empty xml-element (as you showed below) for some primitive C#-type (e.g. int, long), then the .NET deserializer crashes, as it cannot parse the empty value. If you do not send this empty element (which is forced by minOccurs="0" as it seems), the .NET deserializer does his job. Thanx again, Martin On Tue, 2005-08-30 at 10:16 -0400, Mike Woinoski wrote: > Martin, > I don't think there is a Java2WSDL option that adds minOccurs="0" to an > element > definition. However, you can edit the WSDL manually and add it yourself > (sounds > like a good job for an Ant task or shell script.) > > BTW, an element can have both nillable="true" and minOccurs="0". The > semantics > of these attributes is different: nillable="true" allows an XML element to > have > a value equivalent to a Java null reference: > <... xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> > <myelement xsi:nil="true"/> > > This is different than a plain empty element: > <myelement/> > which is equivalent to a Java String object with length 0. > > Mike > > Martin Grotzke wrote: > > Hello, > > > > when creating the wsdl from java classes, is there's any way > > to change the default behavior from generating nillable="true" > > to minOccurs="0" (for interop with .net)? > > > > thanx in advance, > > martin > > > > > -- Martin Grotzke Hohenesch 38, 22765 Hamburg Tel. +49 (0) 40.39905668 Mobil +49 (0) 170.9365656 E-Mail [EMAIL PROTECTED] Online http://www.javakaffee.de
signature.asc
Description: This is a digitally signed message part
