cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Freeman Fang (JIRA)" <j...@apache.org>
Subject [jira] Commented: (CXF-340) Support adding extra classes to JAXB context
Date Mon, 11 Jun 2007 08:41:26 GMT

    [ https://issues.apache.org/jira/browse/CXF-340?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12503328
] 

Freeman Fang commented on CXF-340:
----------------------------------

Hi Steve,

This task is done.

You can add addtional jaxb context class for your server by means of 

        ServerFactoryBean svrBean = new ServerFactoryBean();
        svrBean.setAddress("http://localhost/Hello");
        svrBean.setServiceClass(HelloService.class);
        svrBean.setBus(getBus());

        Map props = svrBean.getProperties();
        if (props == null) {
            props = new HashMap<String, Object>();
        }
        props.put("jaxb.additionalContextClasses", 
                  new Class[] {java.rmi.Remote.class, java.rmi.RemoteException.class});
        svrBean.setProperties(props);
        svrBean.create();


Also almost the same thing on client side

        ClientFactoryBean cfBean = new ClientFactoryBean();
        cfBean.setAddress("http://localhost/Hello");
        cfBean.setBus(getBus());
        cfBean.setServiceClass(HelloService.class);
        Map props = cfBean.getProperties();
        if (props == null) {
            props = new HashMap<String, Object>();
        }
        props.put("jaxb.additionalContextClasses", 
                  new Class[] {java.rmi.Remote.class, java.rmi.RemoteException.class});
        cfBean.setProperties(props);
        Client client = cfBean.create();


> Support adding extra classes to JAXB context
> --------------------------------------------
>
>                 Key: CXF-340
>                 URL: https://issues.apache.org/jira/browse/CXF-340
>             Project: CXF
>          Issue Type: Improvement
>    Affects Versions: 2.0-M1
>            Reporter: Dan Diephouse
>            Assignee: Freeman Fang
>             Fix For: 2.1
>
>
> Users may have their own JAXB classes which need to be included in the context. We should
provide a simple mechanism to add extra classes to the context. (This worked pretty well in
XFire).
> HashMap props = new HashMap();
> props.put("jaxb.additionalContextClasses", new Class[] { Foo.class, Bar.class });
> serverFactory.setProperties(props);
> serverFactory.create();

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message