Re: best practices for Map and List in webservices

2008-02-26 Thread Daniel Kulp


Lists should be completely usable with JAX-WS/JAXB (and Aegis as well) as 
long as you properly type the exact instance.  Example:

class MyBean {
   ListFoo myList;
}

and don't try things like:

class MyBeanT {
   ListT myList;
} 

of 

class MyBean{
   List myList;
}

The last one CAN be made to work, but it may require some extra 
configuration to get the classes that you put into the list added to the 
jaxb context and stuff.   It also maps in to the schema as just an 
xsd:anyType, which can sometimes cause issues with some stacks.

Maps, on the other hand, are really hard to get working (with JAXB).   
You need to write special JavaTypeAdapters things to convert the maps 
to/from special pair beans, and stuff.   It basically requires quite a 
bit more work at this point.

Dan


On Monday 25 February 2008, Daniel Lipofsky wrote:
 I have got some WebServices that basically take and return
 MapString,String and ListString.  I am wondering what is
 considered the best way to do this, especially for interoperability
 with both Java and .NET.  I don't have to use the Java collections
 (although it sure is convenient).  Previously we used WebMethods Glue
 which provided this for us, but I understand it was not great for
 interoperability.

 Thanks,
 Dan



-- 
J. Daniel Kulp
Principal Engineer, IONA
[EMAIL PROTECTED]
http://www.dankulp.com/blog


best practices for Map and List in webservices

2008-02-25 Thread Daniel Lipofsky
I have got some WebServices that basically take and return
MapString,String and ListString.  I am wondering what is
considered the best way to do this, especially for interoperability
with both Java and .NET.  I don't have to use the Java collections
(although it sure is convenient).  Previously we used WebMethods Glue
which provided this for us, but I understand it was not great for
interoperability.

Thanks,
Dan


Re: best practices for Map and List in webservices

2008-02-25 Thread Benson Margulies
Maps are hard. JAXB barely support them, with a ton of snails, in 2.1. I
would personally recommend specifying a vector or list of pairs instead.

On Mon, Feb 25, 2008 at 6:24 PM, Daniel Lipofsky 
[EMAIL PROTECTED] wrote:

 I have got some WebServices that basically take and return
 MapString,String and ListString.  I am wondering what is
 considered the best way to do this, especially for interoperability
 with both Java and .NET.  I don't have to use the Java collections
 (although it sure is convenient).  Previously we used WebMethods Glue
 which provided this for us, but I understand it was not great for
 interoperability.

 Thanks,
 Dan