webservice部署好以后可以自己后台测试
import org.apache.cxf.interceptor.LoggingInInterceptor;
import org.apache.cxf.interceptor.LoggingOutInterceptor;
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
import com.mq.app.webservice.IAllWebservice;
import com.mq.app.webservice.impl.AllWebServiceImpl;
//import com.mq.app.webservice.IQueryWebService;
import org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory;
import com.mq.app.service.IAprovResultService;
public class TestClient {
public static void main(String[] args) {
JaxWsProxyFactoryBean factoryBean=new JaxWsProxyFactoryBean();
factoryBean.getInInterceptors().add(new LoggingInInterceptor());
factoryBean.getOutInterceptors().add(new LoggingOutInterceptor());
factoryBean.setServiceClass(IAllWebservice.class);
factoryBean.setAddress("http://localhost:8080/mq/webserver/AllWebServiceImpl?wsdl");
IAllWebservice impl=(IAllWebservice) factoryBean.create();
// for(int i=1;i<=100;i++){
String encryptStrJson=Test.test1("D:/test/htjson.txt");
System.out.println(impl.synchronizeContract(encryptStrJson));
// }
}
}
webservice cxf 的后台调用,测试用
最新推荐文章于 2018-04-10 15:05:35 发布