1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
| package com.test.client;
/*import javax.activation.DataHandler;
import javax.activation.DataSource;
import javax.activation.FileDataSource;*/
import org.apache.cxf.interceptor.LoggingInInterceptor;
import org.apache.cxf.interceptor.LoggingOutInterceptor;
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
import com.test.TestCxfService;
public final class Client {
private Client() {
}
public static void main(String args[]) throws Exception {
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
factory.getInInterceptors().add(new LoggingInInterceptor());
factory.getOutInterceptors().add(new LoggingOutInterceptor());
factory.setServiceClass(TestCxfService.class);
factory.setAddress
("http://localhost:8080/cxf1/services/UploadResumeWS");
TestCxfService client = (TestCxfService) factory.create();
System.out.println("==>"+client.add(4,5));
System.exit(0);
}
} |