Thanks for that Rick, I suspected as much, :(, but at least I know I haven't missed anything obvious. For now, I'll go with Strings on these problem methods (as I am wrapping an existing API that I don't want to change).
Keith -----Original Message----- From: Rick Kellogg [mailto:[EMAIL PROTECTED] Sent: 12 December 2003 12:13 To: [EMAIL PROTECTED] Subject: RE: Best practice for Java Object types like Integer, Long, ... Keith, In general, the approach you are taking will not work with other languages. You see for example, C# does not include a Long data type. It only includes long and Object. I suggest another approach using marker values. Good luck, Rick -----Original Message----- From: Keith Hatton [mailto:[EMAIL PROTECTED] Sent: Friday, December 12, 2003 6:00 AM To: Axis-User (E-mail) Subject: Best practice for Java Object types like Integer, Long, ... Not an Axis-specific question, more about WSDL and Java... I have a number of methods with parameters or return types like java.lang.Integer or java.lang.Long. Using Java2WSDL/WSDL2Java these get converted into int and long, which is not what I need - null is a valid value. But I can't put nillable="true" in the <wsdl:part ... /> sections of my <wsdl:message .../> elements. How can I work around this? In some cases I have declared dummy types in my WSDL to work around this, like so: <simpleType name="searchID"> <xsd:restriction base="xsd:long" nillable="true"/> </simpleType> But (a) this is rather ugly and (b) I have now hit a further problem where the return type is java.lang.Long. My Web Service class could wrap these methods and accept/return Strings instead, but of course that loses a lot of type information. Any ideas appreciated - I would have thought this was an FAQ but a (quick) search didn't reveal anything. Thanks Keith