2
votes

For customers to create apache cxf client of your web service, if they use JaxWsProxyFactoryBean, they need the endpoint address and the SEI code. About providing endpoint address there is no problem, but how you provide the SEI ? You just export the interface within a jar and give the jar to the customer ? Each time you change the SEI, you must contact with all customers and give the jar again ?

I mean the IDataService interface in below example:

public static void main(String[] args) throws SomeException {  

    JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
    factory.getInInterceptors().add(new LoggingInInterceptor());
    factory.getOutInterceptors().add(new LoggingOutInterceptor());
    factory.setServiceClass(IDataService.class);
    factory.setAddress("http://localhost:8080/WSTest/services/dataService");
    IDataService client = (IDataService) factory.create();

}
1

1 Answers

3
votes

Ideally you should just be giving them the WSDL of the service - WSDL should the contract here using which they can generate their own set of templates using whatever tool is available to them - wsdl2java etc.

If the client is an internal to your company, then yes, you can as well create a thin project with just the interfaces, types, messages, package it as a jar and provide the jar via some internal repository, assuming that your interface does not too often and even if it changes, that it is published afresh to the internal repository.