Nice explanation Mauro! Your explanation shows the value of a good defined WSDL spec. This is the case because the WSDL is used to specify the contract. In one of my earlier messages I explained and linked to some information about strong typed WSDL files.
Therefore I think the approach to use java2wsdl is wrong. Because you're first writing an implementation and then build a contract around it. You should do that in reverse order and thus start with specifying the WSDL and generate code from that (well-defined) contract. This also abstracts from any implementation language which adds even more value imho. This doesn't solve your problem but I hope it gives you a view from another perspective. Just my two cents... Regards, Sietse -----Original Message----- From: Mauro Molinari [mailto:[EMAIL PROTECTED] Sent: 27 November 2007 08:07 To: [email protected] Subject: Re: Microsoft interop gotcha - WSDL with minOccurs="0", type="xs:long" Hi Jason, the first "problem" is that .NET translates optional WSDL elements (i.e.: those with minOccurs="0" and maxOccurs="1" - please note maxOccurs="1" is the default, if not specified) with a second boolean parameter like "xxxSpecified" that states if the previous parameter has been specified or not. This is because .NET 1.1 was not able to specify null for primitive types (like int, long, etc.; string is an exception), so the convention is the following: - <any value>, xxxSpecified = false => means "null" - <a value>, xxxSpecified = true => means "value" .NET 2.0 behaves the same, probably because of some kind of retro-compatibility. However, I would not consider that a big problem. If you are sure your parameters cannot be null, you can manually delete all minOccurs="0"; otherwise, you may remove minOccurs="0" and substitute with nillable="true", but be careful: as I said before, .NET 1.1 cannot specify null for primitive types, so a .NET 1.1 client would not be able to specify null for, say, an int parameter marked as nillable="true". .NET 2.0 does not have this problem. The second (and real) problem is that if you are writing your web services bottom up, Axis2 Java2WSDL always generates minOccurs="0" and, in some circumstances, this can lead to bigger problems that the one you described. Please also have a look to my bug report: http://issues.apache.org/jira/browse/AXIS2-3300 Cheers. -- Mauro Molinari Software Developer [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
