cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benson Margulies" <bimargul...@gmail.com>
Subject Re: How to pass a HashMap
Date Sat, 23 Feb 2008 18:13:47 GMT
This is now CXF-1451. Please comment there, but mostly stand by whilst I try
to make some sense of it.

On Sat, Feb 23, 2008 at 1:11 PM, Benson Margulies <bimargulies@gmail.com>
wrote:

> I've reproduced this.
>
> On Fri, Feb 22, 2008 at 4:39 PM, Li, Weiye <Weiye.Li@stjude.org> wrote:
>
> > The CXF document says that Aegis data binding can even works on Map. I
> > tried this, but it always return an empty one. Here's my testing codes. Did
> > I miss something? Or I need to write special config file?
> >
> >
> >
> >
> > @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();
> >
> > }
> >
> >
> >
> >
> >
> > public static void main(String args[]) throws Exception {
> >
> >      JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
> >
> >      factory.setServiceClass(test.EmicroService.class);
> >
> >      factory.setAddress("http://localhost:9080/emicro-ws/EmicroService
> > ");
> >
> >      factory.getServiceFactory().setDataBinding(new AegisDatabinding());
> >
> >
> >
> >      EmicroService client = (EmicroService)factory.create();
> >
> >
> >
> >        // add 2 employees here, then
> >
> >
> >
> >        Map<Integer, Employee> emap = client.getEmployeesMap();
> >
> >        logger.info(emap);
> >
> >
> >
> >        System.exit(0);
> >
> >    }
> >
> >
> >
> > The backend configuration is just following the CXF tutorial
> > <bean id="aegisBean" class="
> > org.apache.cxf.aegis.databinding.AegisDatabinding" scope="prototype"/>
> >
> >
> >
> >      <bean id="jaxws-and-aegis-service-factory"
> >
> >            class="org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean"
> > scope="prototype">
> >
> >            <property name="dataBinding" ref="aegisBean" />
> >
> >            <property name="serviceConfigurations">
> >
> >                  <list>
> >
> >                        <bean class="
> > org.apache.cxf.jaxws.support.JaxWsServiceConfiguration" />
> >
> >                        <bean class="
> > org.apache.cxf.aegis.databinding.AegisServiceConfiguration" />
> >
> >                        <bean class="
> > org.apache.cxf.service.factory.DefaultServiceConfiguration" />
> >
> >                  </list>
> >
> >            </property>
> >
> >      </bean>
> >
> >
> >
> >
> >
> >      <bean id="emicro" class="org.stjude.ri.emicro.ws.EmicroServiceImpl"
> > />
> >
> >
> >
> >      <jaxws:endpoint id="helloWorld" implementor="#emicro"
> > address="/EmicroService">
> >
> >            <jaxws:serviceFactory>
> >
> >                  <ref bean='jaxws-and-aegis-service-factory' />
> >
> >            </jaxws:serviceFactory>
> >
> >      </jaxws:endpoint>
> >
> >
> >
> >
> >
> > Any advice? Thanks
> >
> >
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message