On Monday 25 February 2008, Benson Margulies wrote:
> The use of HashMap as a JAX-WS wrapper type may be a problem. Let me
> try the Map<x,y> experiment in my testbed.

Uhh....  yea.   In general, unless you REALLY know what you are doing, 
for code first, don't put @RequestWrapper and @ResponseWrapper 
annotations.     

Setting the classname in them to something other than a properly 
constructed wrapper type can definitely lead to issues.      In this 
case, if you wanted to use them, you would have to create a bean like:

class GetEmployeesMap {
    Map<Integer, Employee> _return;
    ....getReturn getter
    ....setReturn setter
}

Even then, I'm not sure it would work as I don't know how or if aegis can 
deal with the wrapper types.

So, in summary, don't use them.    Unless the code generator has 
specifically put them there (wsdl2java), ignore them.

Dan
  




On Monday 25 February 2008, Benson Margulies wrote:
> The use of HashMap as a JAX-WS wrapper type may be a problem. Let me
> try the Map<x,y> experiment in my testbed.
>
> On Mon, Feb 25, 2008 at 10:29 AM, Li, Weiye <[EMAIL PROTECTED]> 
wrote:
> > I think I may have to declare .aegis.xml.
> > It was my 2nd try (I mean, use Map only). I did use Map<Integer,
> > Employee> on my first try and the outcome is the same: empty map
> > returned.
> >
> > On 2/24/08 12:09 PM, "Benson Margulies" <[EMAIL PROTECTED]>
> > wrote:
> >
> > It does work. But you have to tell it what's in the map. Either
> > declare the
> > type as
> >
> > Map<A,B>, or use a .aegis.xml file to tell it.
> >
> > > > @WebService(name="EmicroManager",
> > > > targetNamespace="http://test.emicro";)
> > > > @SOAPBinding(style=Style.RPC, use=Use.LITERAL, parameterStyle=
> > > > ParameterStyle.WRAPPED)
> > > > public interface EmicroService {
> > > >      @WebMethod
> > > >      @RequestWrapper(className="test.model.Employee",
> > > >                  localName="employee", targetNamespace="
> > > > http://test.emicro/types ")
> > > >      @Oneway
> > > >      public void addEmployee(Employee emp);
> > > >
> > > >
> > > >      @WebMethod(operationName="getEmployeesAsMap")
> > > >      @ResponseWrapper(className="java.util.HashMap",
> > > >                  localName="EmployeesMap", targetNamespace="
> > > > http://test.emicro/types";)
> > > >      public Map getEmployeesMap();



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

Reply via email to