[ http://issues.apache.org/jira/browse/AXIS-2208?page=comments#action_12320911 ]
Martin Grotzke commented on AXIS-2208: -------------------------------------- d'oh, clearly this parameter is nothing to add to wsdl2java, as it concerns the schema generation :) > Add a parameter to wsdl2java to generate minOccurs="0" for nillable types. > -------------------------------------------------------------------------- > > Key: AXIS-2208 > URL: http://issues.apache.org/jira/browse/AXIS-2208 > Project: Apache Axis > Type: New Feature > Components: WSDL processing > Reporter: Martin Grotzke > Priority: Minor > > hello, > is it possible to add a parameter to wsdl2java, that forces the generation of > minOccurs="0" for nillable types? > the problem that this solves: > if you use a wrapper type like Integer in java, it get's translated to an > xsd:int. > if you generate C# classes using .net 1.1, this will be translated to a C# > int, > a primitive type that is not nullable (AFAIK nullable types are introduced in > .net 2.0). > then, when sending a soap request from java to the .net webservice, and leave > a property of such a wrapper type null, an empty element is sent over the > wire. > the .net deserializer tries to deserialize this element, but fails to create a > primitive value for this - on the java client side you receive a soap fault. > if you have the additional attribute minOccurs="0" in your schema, > everything's > ok: when generating classes from the wsdl, for each element with minOccurs="0" > an additional property is generated like "FooDefined:boolean" (IIRC), that > can be used by the C#-developer to determine, if the primitive type is > initialized. > when you invoke the webservice, no empty element will be transferred, so the > .net deserializer does not try to create a primitive value for this, but it > initializes > the "FooDefined:Boolean" correctly. > to support interop with platforms like .net it would be great to have the > possibility > to specify, if minOccurs="0" shall be generated in the schema for wsdl2java > (including the ant task). > thanx in advance, > martin -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
