On Friday 30 May 2008, Abid Hussain wrote:
> Hi again,
> 
> > I don't want to feed a flamewar but if we are in confession mode I must
> > say my experience is the direct opposite from yours...
> Neither do I... just wanted to share my experience.
> 
> > On the other hand running the wsdl2java step is not required since the 
> > apache-cxf
> > creates the proxy client on the  fly. This way the remote calls are feeling
> > natural and you don't have to create weird proxies to abstract the fact that
> > you are calling code via ws.
> What do you mean by "on the fly"? You have to do code-generation to call 
> the operations and use the datatypes from the remote service.
> 
> Regards,
> 
> Abid
> 

Hi Abid,

Read
http://cwiki.apache.org/CXF20DOC/simple-frontend-configuration.html
especially at 
Configure with Spring for the simple front end client

With the proper configuration in spring you don't need any code
generation at all.

However with the spring configuration I wasn't able to override
the service url so I ended up using something like that

    public static <T> T getProxyClient(String url, Class<T> service_class) {
        log.info("Creating proxy client for " + url);

        ClientProxyFactoryBean proxy_factory = new ClientProxyFactoryBean();
        proxy_factory.setServiceClass(service_class);
        proxy_factory.setDataBinding(new AegisDatabinding());
        proxy_factory.setAddress(url);

        Object proxy_client = proxy_factory.create();
        //Client client = ClientProxy.getClient(proxy_client);
        //final String protocol = url.substring(0, url.indexOf(':'));
        //enableCFXProxy(protocol, client);

        return (T) proxy_client;
    }

where service_class is the interface that the ws exposes.

          Vassilis

Reply via email to