webservice cxf 的后台调用,测试用

    xiaoxiao2021-03-25  114

    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)); // } } }
    转载请注明原文地址: https://ju.6miu.com/read-12998.html

    最新回复(0)