RE: java.util.List and 1.1.RC2
For fromArray(), you mean this? java.util.Arrays.asList(Object[]) -Original Message- If you go return (Foo)list.toArray(new Foo[0]); You can turn a list to an array in a snap. A fromArray() would be nice to match it.
Re: java.util.List and 1.1.RC2
Keith Hatton wrote: For fromArray(), you mean this? java.util.Arrays.asList(Object[]) -Original Message- If you go return (Foo)list.toArray(new Foo[0]); You can turn a list to an array in a snap. A fromArray() would be nice to match it. you learn something new every day. Thanks
Re: [java.util.List and 1.1.RC2]
Jim, There seem to be two separate issues here. The one (which bug 8435 addresses) is how to emulate an enumeration type, which of course is not natively supported in Java. I could have sworn recently I saw (maybe on this list) a roundabout example how to code a Java class that Axis would recognize as an enumeration. The class made use of public constants together with getters/setters. It would be helpful if bug 8435s text was amended with this example. The other issue (which you appear to be interested in) concerns support for the collections classes/interfaces in the java.util package. It seems to me that collections should NOT be supported because such support is not prescribed by JAX-RPC 1.0. Literal arrays with [] only. However, I have experimented with Axis 1.1 RC2 and noticed that Java2WSDL does try to deal with a java.util.ArrayList and the like. My generated WSDL winds up with the following: complexType name=Array ___complexContent __restriction base=soapenc:Array _attribute ref=soapenc:arrayType wsdl:arrayType= / __/restriction ___/complexContent /complexType This type seems meaningless and potentially dangerous because its an array of what? The wsdl:arrayType=. Im curious what else needs to be done to get this to work. Not that it necessarily should work, though. Brain, Jim [EMAIL PROTECTED] wrote: Does anyone know if: Bugzilla Bug 8435 [xsd:list] WSDL2Java doesn't handle schema list enumerations has been fixed. I don't know how current Bugzilla is, though I concerned it is, as this seems to preclude the use of AXIS for our project (makes heavy use of Lists) Jim Jim Brain, [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] Researching tomorrow's decisions today. (319) 369-2070 (work) Systems Architect, ITS, AEGON Financial Partners
Re: java.util.List and 1.1.RC2
Brain, Jim wrote: Does anyone know if: Bugzilla Bug 8435 [xsd:list] WSDL2Java doesn't handle schema list enumerations if its open, its probably open; you can always write a test to make sure. Note that is the special case of a list enum, not a simple list. The way .NET serialises a bitfield enum with things like foo=1 bar=2 and a value of foo | bar is to pump out foo bar/ which axis doesnt handle. These are not java lists, which you seem to be talking about has been fixed. I don't know how current Bugzilla is, though I concerned it is, as this seems to preclude the use of AXIS for our project (makes heavy use of Lists) On the contrary, you have an opportunity to customise axis to meet your needs, and contribute something back to the community.
Re: [java.util.List and 1.1.RC2]
Mitch Gitman wrote: Jim, There seem to be two separate issues here. The one (which bug 8435 addresses) is how to emulate an enumeration type, which of course is not natively supported in Java. I could have sworn recently I saw (maybe on this list) a roundabout example how to code a Java class that Axis would recognize as an enumeration. The class made use of public constants together with getters/setters. It would be helpful if bug 8435s text was amended with this example. no, this is a special case of bitfield enums that axis doesnt handle yet.
RE: java.util.List and 1.1.RC2
All I know at present is that when I expose a method that returns List, the Java2WSDL piece in AXIS complains bitterly when I do ?WSDL. As for customizing AXIS, I'm willing to try, but my knowledge of the inner workings of AXIS is extremely limited. Jim Jim Brain, [EMAIL PROTECTED] Researching tomorrow's decisions today. (319) 369-2070 (work) SYSTEMS ARCHITECT, ITS, AEGON FINANCIAL PARTNERS -Original Message- From: Steve Loughran [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 02, 2003 12:08 PM To: [EMAIL PROTECTED] Subject:Re: java.util.List and 1.1.RC2 Brain, Jim wrote: Does anyone know if: Bugzilla Bug 8435 [xsd:list] WSDL2Java doesn't handle schema list enumerations if its open, its probably open; you can always write a test to make sure. Note that is the special case of a list enum, not a simple list. The way .NET serialises a bitfield enum with things like foo=1 bar=2 and a value of foo | bar is to pump out foo bar/ which axis doesnt handle. These are not java lists, which you seem to be talking about has been fixed. I don't know how current Bugzilla is, though I concerned it is, as this seems to preclude the use of AXIS for our project (makes heavy use of Lists) On the contrary, you have an opportunity to customise axis to meet your needs, and contribute something back to the community.
Re: java.util.List and 1.1.RC2
Brain, Jim wrote: All I know at present is that when I expose a method that returns List, the Java2WSDL piece in AXIS complains bitterly when I do ?WSDL. As for customizing AXIS, I'm willing to try, but my knowledge of the inner workings of AXIS is extremely limited. What I did is to just turn the list into an array of beans, and pass that around. The only advantage of a list is that it can change in size, but once I send it to the client it will not change in size. It is also trivial to turn that back into a list on the .NET side.
Re: java.util.List and 1.1.RC2
Right, refer to the Forgive me... message which I sent out five minutes later when I realized this. I'm still wondering about the apparent existing support for java.util.List and the like. It seems to me that Java2WSDL should generate an exception when it comes across a collection class that stores java.lang.Object instances. Steve Loughran [EMAIL PROTECTED] wrote: Mitch Gitman wrote: Jim, There seem to be two separate issues here. The one (which bug 8435 addresses) is how to emulate an enumeration type, which of course is not natively supported in Java. I could have sworn recently I saw (maybe on this list) a roundabout example how to code a Java class that Axis would recognize as an enumeration. The class made use of public constants together with getters/setters. It would be helpful if bug 8435s text was amended with this example. no, this is a special case of bitfield enums that axis doesnt handle yet.
RE: java.util.List and 1.1.RC2
I know, and I thought of that. Unfortunately, I need to expose 296 service classes, containing 5000 references to List, and I have a program that is creating web service wrappers for all the classes (the original classes combined data and access logic, which had to split in half to work in the web service world. The program I wrote can be applied to any arbitrary class, though, uses reflection, and I am planning on cleaning it up and offering it). Programmatically, I can't determine the data type of a List, so I have to replace with Object[], which isn't much better (although AXIS WSDL code seems to like that) Jim Jim Brain, [EMAIL PROTECTED] Researching tomorrow's decisions today. (319) 369-2070 (work) SYSTEMS ARCHITECT, ITS, AEGON FINANCIAL PARTNERS -Original Message- From: James Black [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 02, 2003 12:27 PM To: [EMAIL PROTECTED] Subject:Re: java.util.List and 1.1.RC2 Brain, Jim wrote: All I know at present is that when I expose a method that returns List, the Java2WSDL piece in AXIS complains bitterly when I do ?WSDL. As for customizing AXIS, I'm willing to try, but my knowledge of the inner workings of AXIS is extremely limited. What I did is to just turn the list into an array of beans, and pass that around. The only advantage of a list is that it can change in size, but once I send it to the client it will not change in size. It is also trivial to turn that back into a list on the .NET side.
Re: java.util.List and 1.1.RC2
Mitch Gitman wrote: Right, refer to the Forgive me... message which I sent out five minutes later when I realized this. yeah, I caught that I'm still wondering about the apparent existing support for java.util.List and the like. It seems to me that Java2WSDL should generate an exception when it comes across a collection class that stores java.lang.Object instances. That is one thing wrong with collections; you cannot state in advance their type, and the thing at the far end cannot deal with arbitrary java objects. If you go return (Foo)list.toArray(new Foo[0]); You can turn a list to an array in a snap. A fromArray() would be nice to match it. However, there is meant to be something in soap where you do say you are returning an Object and the type is passed in the envelope at run time. I dont know the exact details...
Re: java.util.List and 1.1.RC2
Brain, Jim wrote: I know, and I thought of that. Unfortunately, I need to expose 296 service classes, containing 5000 references to List, and I have a program that is creating web service wrappers for all the classes (the original classes combined data and access logic, which had to split in half to work in the web service world. The program I wrote can be applied to any arbitrary class, though, uses reflection, and I am planning on cleaning it up and offering it). Programmatically, I can't determine the data type of a List, so I have to replace with Object[], which isn't much better (although AXIS WSDL code seems to like that) You cant add xdoclet metadata to state the type of lists? I really miss typed datastructures, its the main bit of C++ that I still miss, even if its templating was awful compared to that of the polymorphic type inference features of Standard ML. I guess porting to the generics compiler is out too, huh :) That's OK, axis cant handle that iether. It seems to me that if Axis handles Object[] then it should be able to serialize List, at the very least by going List.toArray() returning the object array. typing would be a nice extra, with a configurable in the WSDD declarations that stated the java class in the list. You sound like you are doing a major undertaking there. I wish you well -you could probably derive an interesting paper or two from the experience. I'll point you at my making web-services-that-work paper http://www.iseran.com/Steve/papers/wstw/ which may be of interest -steve
Re: [Re: java.util.List and 1.1.RC2]
I've used toArray() numerous times in my service code and had no problem with that. Obviously, Jim (the fellow who started this thread) doesn't have the luxury of coding that manually. My point, to be more precise, is that JAX-RPC 1.0 says nothing about java.util collections classes/interfaces. Of course, Axis doesn't compromise its compliance with the JAX-RPC spec by providing functionality that extends the spec, but as a developer I am reluctant to use that extended functionality. Personally, I would prefer to see collections explicitly disallowed (Java2WSDL would throw an exception), so developers don't step in something they didn't see. But if collections are allowed, I would like to see that clearly documented. Naturally, if I would like to see something, I am free to produce it myself. But that goes back to my question: how does Axis 1.1 RC2 support java.util collections besides Java2WSDL's just blindly producing a generic Array complex type? The most I've read on this subject is a cryptic mention of the --extraClasses argument to Java2WSDL. Concerning there is meant to be something in soap where you do say you are returning an Object and the type is passed in the envelope at run time. I don't understand how passing a type name in the SOAP envelope helps since the SOAP engine can dynamically build the SOAP message at request time anyway, and the SOAP engine still must fill in the XML Schema type's elements corresponding to the dynamically identified class' fields. Steve Loughran [EMAIL PROTECTED] wrote: Mitch Gitman wrote: I'm still wondering about the apparent existing support for java.util.List and the like. It seems to me that Java2WSDL should generate an exception when it comes across a collection class that stores java.lang.Object instances. That is one thing wrong with collections; you cannot state in advance their type, and the thing at the far end cannot deal with arbitrary java objects. If you go return (Foo)list.toArray(new Foo[0]); You can turn a list to an array in a snap. A fromArray() would be nice to match it. However, there is meant to be something in soap where you do say you are returning an Object and the type is passed in the envelope at run time. I dont know the exact details...
RE: java.util.List and 1.1.RC2
Well, I don't mean to toot my own horn, but I am rather impressed with my tool. It supports the following features: * Automatically takes classes with mixed data (getters/setters) and action methods and splits them into Beans and Impl Action classes * Converts all methods to throw RemoteException * flattens inheritance model so that classes in the same package are inherited. All inherited methods out of package are rolled into the lowest base class that is in package. (I know, this sounds like it should not work, but it does, and if I find a case where it does not work, it can be turned off, but it works well to simplify the data beans) * Spits out either one Wsdd or one wsdd per class in package * Can convert an entire package at once * Supports outputting classes with overloaded methods or without. (adds 2,3,4 to overloaded versions) * Optionally excludes entire classes -x jim.MyClass or specific methods -x jim.MyClass.method1 or the more global *.method1 * Optionally Simplifies Vectors and Lists into array of Object. * Creates JAX-RPC interfaces for Action classes * User defined extensions for Bean, Interface, and Action classes (defaults to ,IF, and Impl) * Automatically walks the extension tree to add beanMappings to WSDD file for all classes used in a service 1200 line program, and pretty messy (it was not designed for long term use, just to get this set of vendor classes ready for Web service consumption). But, if there is interest in a TIE (I think that is the name) gen tool that cleans up arbitrary classes for consumption, let me know. As to your suggestion below, I can if I go through the actual class code, but that is a vendor product, and I'm not sure it's going to be easy to find 9they are very heavy inheritance users) Jim Jim Brain, [EMAIL PROTECTED] Researching tomorrow's decisions today. (319) 369-2070 (work) SYSTEMS ARCHITECT, ITS, AEGON FINANCIAL PARTNERS -Original Message- From: Steve Loughran [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 02, 2003 1:44 PM To: [EMAIL PROTECTED] Subject:Re: java.util.List and 1.1.RC2 Brain, Jim wrote: I know, and I thought of that. Unfortunately, I need to expose 296 service classes, containing 5000 references to List, and I have a program that is creating web service wrappers for all the classes (the original classes combined data and access logic, which had to split in half to work in the web service world. The program I wrote can be applied to any arbitrary class, though, uses reflection, and I am planning on cleaning it up and offering it). Programmatically, I can't determine the data type of a List, so I have to replace with Object[], which isn't much better (although AXIS WSDL code seems to like that) You cant add xdoclet metadata to state the type of lists? I really miss typed datastructures, its the main bit of C++ that I still miss, even if its templating was awful compared to that of the polymorphic type inference features of Standard ML. I guess porting to the generics compiler is out too, huh :) That's OK, axis cant handle that iether. It seems to me that if Axis handles Object[] then it should be able to serialize List, at the very least by going List.toArray() returning the object array. typing would be a nice extra, with a configurable in the WSDD declarations that stated the java class in the list. You sound like you are doing a major undertaking there. I wish you well -you could probably derive an interesting paper or two from the experience. I'll point you at my making web-services-that-work paper http://www.iseran.com/Steve/papers/wstw/ which may be of interest -steve