[ https://issues.apache.org/jira/browse/AXIS2-3300?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mauro Molinari reopened AXIS2-3300: ----------------------------------- If I understand it right, you chose to use minOccurs=1 (which is the default if no minOccurs is specified) in ANY case. This is not good. As I wrote in the dev list, in this way if you start from a Java code like this: public Integer methodA(Integer a); which supports a null input parameter and can return a null output value, Java2WSDL will then create a WSDL with both input and output parameters without any minOccurs attribute (=> minOccurs=1). Then, if you try to generate an Axis2 client from that WSDL using WSDL2Java, you'll then end up with a Java method like this: public int methodA(int a); This because both the input and output parameters are declared as mandatory. In this case the Axis2 client wouldn't be able to specify "null" as input parameter and won't be able to handle null as an output parameter! And please, don't say that the developer can use the ugly Axis2 convention that Integer.MIN_VALUE is considered to be null!!! Actually, thinking a little deeper on this, I think that an error would be generated even sooner if the service implementation of methodA returns null, because the Axis2 stack would have to transmit a "null" as the operation return value, but that operation was declared as mandatory in the WSDL... > minOccurs="0" always generated by Java2WSDL - problems with .NET client > generation > ---------------------------------------------------------------------------------- > > Key: AXIS2-3300 > URL: https://issues.apache.org/jira/browse/AXIS2-3300 > Project: Axis2 > Issue Type: Bug > Components: Tools > Affects Versions: 1.3 > Reporter: Mauro Molinari > Assignee: Deepal Jayasinghe > Attachments: axis2-1.4.1.diff > > > When you try to expose a POJO as a webservice, suppose you have two Java > methods with the following signatures: > public Integer a(String, Integer) > public String b(Integer, String) > Java2WSDL adds the minOccurs="0" for each element of each complex type, both > for the input parameters and for the output parameters. > When generating clients using .NET WebService Studio 2.0, the result is the > following: > - all the generated C# methods input parameters are doubled, except for the > string ones: the doubled parameters are booleans whose meaning is: "is the > previous parameter specified or not?" > - all the generated C# methods return parameters are void, except for the > string ones > The actual result are clients with methods like these: > public void a(string, int, bool); > public string b(int, bool, string); > This is obviously a problem, particularly for the "void" return type. > If I remove minOccurs="0", clients are generated correctly by .NET WebService > Studio 2.0. > The issue is this: why does Java2WSDL always adds minOccurs="0"? If its > meaning were "it can be null", I think nillable="true" attribute should be > more appropriate... Moreover, if I substitute Integer with int in the > original Java class methods, minOccurs="0" is still added by Java2WSDL, even > if an int cannot be null. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.