Dr. Jung and others, I came up with a way to generically and tolerantly serialize and deserialize any Object.
I use java.beans.XMLEndoder in a class that implements Serializer, and I use java.beans.XMLDecoder in a class that extends SimpleDeserializer. Pros: 1) It's reusable for any object, so you don't need to have a serializer and deserializer for each of your custom data types. 2) It's tolerant of "gets without sets" and other problems that "strict javabean" encoders have. 3) It comes with the JDK. 4) It handles the Collection problem I talked about. (Actually, I changed the type to java.util.List, but in my client-config.xml and web-service.xml, I have to have a typeMapping of the exact impl: in my case, ArrayList.) Cons: 1) It depends on JDK 1.4. 2) It's a bit (can't quantify yet) slower. If (the jboss team) wants to include it in their jboss.net codebase, I'd be happy to share it, though I'd have to check with my boss first. Still, with the description I gave I'm sure anyone could implement it (the operative code in each class is less between 6-10 lines!). Thanks for all your help! David -- Jung , Dr. Christoph wrote: > David, > > IMO, Collection is a particularily bad type to map XML-Schema to and from in > Axix. If you use an array or > a vector, the automatic mapping of Axis will however do something > meaningful. > > I�m currently working on an additional annotation of the Java-methods that > will allow to specify the > Xml-mapping used, such that a Collection argument of return type can be > mapped to typed arrays, datasets and the like. > > CGJ > > > -----Urspr�ngliche Nachricht----- > Von: David Ward [mailto:[EMAIL PROTECTED]] > Gesendet: Montag, 10. Juni 2002 09:29 > An: [EMAIL PROTECTED] > Betreff: [JBoss-user] IllegalArgumentException from jboss.net to SLSB > > > (JBoss 3.0.0 final, Sun Linux JDK 1.4.0_01.) > > I have an axis client hitting jboss.net, which in turn executes a > stateless ejb of mine. > > When I make calls to a method of: > > public UserData addUser(UserData pOrigData, PersistenceLevel pLevel) > > I have no problem. The problem comes when the first argument turns into > a Collection in another method: > > public Collection addUsers(Collection pOrigDatas, PersistenceLevel pLevel). > > Not sure why the Collection is confusing things (causing an "argument > type mismatch"). Here's my stack trace - > > Thanks for any and all help, > David > > -- > > [java] java.lang.IllegalArgumentException: argument type mismatch on > object "$Proxy74", method name "addUsers", tried argument types: > [Ljava.lang.Object;, com.dotech.gizzard.persistence.PersistenceLevel > [java] at > org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:13 > 5) > [java] at > org.apache.axis.encoding.DeserializationContextImpl.endElement(Deserializati > onContextImpl.java:865) > [java] at > org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1528) > [java] at > org.apache.crimson.parser.Parser2.content(Parser2.java:1779) > [java] at > org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1507) > [java] at > org.apache.crimson.parser.Parser2.content(Parser2.java:1779) > [java] at > org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1507) > [java] at > org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:500) > [java] at > org.apache.crimson.parser.Parser2.parse(Parser2.java:305) > [java] at > org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:442) > [java] at javax.xml.parsers.SAXParser.parse(SAXParser.java:345) > [java] at > org.apache.axis.encoding.DeserializationContextImpl.parse(DeserializationCon > textImpl.java:201) > [java] at > org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:428) [java] > at > org.apache.axis.client.Call.invoke(Call.java:1793) > [java] at org.apache.axis.client.Call.invoke(Call.java:1594) > [java] at org.apache.axis.client.Call.invoke(Call.java:1513) > [java] at org.apache.axis.client.Call.invoke(Call.java:1093) > [java] at > com.dotech.gizzard.persistence.axis.AXISPersistenceManagerFactory$1.invoke(A > XISPersistenceManagerFactory.java:46) > [java] at $Proxy0.addUsers(Unknown Source) > [java] at > com.dotech.gizzard.persistence.test.UserTest.addUsers(UserTest.java:66) > [java] at > com.dotech.gizzard.persistence.test.UserTest.main(UserTest.java:31) > > > _______________________________________________________________ > > Don't miss the 2002 Sprint PCS Application Developer's Conference August > 25-28 in Las Vegas - > http://devcon.sprintpcs.com/adp/index.cfm?source=osdntextlink > > _______________________________________________ > JBoss-user mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/jboss-user > ########################################### > > This message has been scanned by F-Secure Anti-Virus for Microsoft Exchange. > For more information, connect to http://www.F-Secure.com/ > > _______________________________________________________________ > > Don't miss the 2002 Sprint PCS Application Developer's Conference > August 25-28 in Las Vegas - http://devcon.sprintpcs.com/adp/index.cfm?source > _______________________________________________ > JBoss-user mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/jboss-user -- --------------------- David Ward [EMAIL PROTECTED] http://www.dotech.com _______________________________________________________________ Don't miss the 2002 Sprint PCS Application Developer's Conference August 25-28 in Las Vegas - http://devcon.sprintpcs.com/adp/index.cfm?source=osdntextlink _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
