cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim Ma <...@iona.com>
Subject Question about aegis databinding
Date Tue, 03 Jul 2007 06:59:46 GMT
Hi Dan ,

I want to figure out if we can implement another code first tool using 
aegis databinding  to generate client code and server code.
for the pojo service class and types classes. The server code is simple 
and easy to write ,we only need to set Aegis databinding
for the service factory . But the client code need to register type 
class in Aegis like below snippet :

        ClientProxyFactoryBean proxyFactory = new ClientProxyFactoryBean();
        ClientFactoryBean clientBean = proxyFactory.getClientFactoryBean();
        clientBean.setAddress("http://localhost:8088/Hello");
        clientBean.setBus(CXFBusFactory.getDefaultBus());
        clientBean.setTransportId("http://schemas.xmlsoap.org/wsdl/http/");
        clientBean.setServiceClass(BookService.class);
        BookService client = (BookService) proxyFactory.create();
        ClientImpl c = (ClientImpl)clientBean.getClient();

        AegisDatabinding db = new AegisDatabinding();
        Service  s = c.getEndpoint().getService();
        s.setDataBinding(db);
        db.initialize(s);

        TypeMapping tm = (TypeMapping) s.get(TypeMapping.class.getName());
        BeanType type = new BeanType();
        type.setSchemaType(new QName("http://org.codehaus.xfire.client", 
"Book"));
        type.setTypeClass(Book.class);
        type.setTypeMapping(tm);
        tm.register(type);

        Book book = new Book();
        book.setTitle("myname is share");
        book.setIsbn("isbn");
        client.addBook(book);

Is there any way we can simplify register type mapping in aegis by 
reflecting interface class ?
Can we register types class in Aegis like this ?
        TypeMapping tm = (TypeMapping) s.get(TypeMapping.class.getName());
         tm.registerByRef(BookService.class);

I do not know if Aegis can use converted package name and classname as 
default namespace and localpart to construct Aegis
schemaType for every types class, and if it can construct BeanType , 
ArrrayType or other type by reflecting the types class .

Thanks

Jim


      

Mime
View raw message