web services 接口测试方法

public class Test {

    public static void main(String[] args) {
                JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();    
                factory.getInInterceptors().add(new LoggingInInterceptor());    
                factory.getOutInterceptors().add(new LoggingOutInterceptor());    
                factory.setServiceClass(IhlWebservice.class);    
                factory.setAddress("http://localhost:8080/charge/services/reportStatusService");    
                IhlWebservice client = (IhlWebservice) factory.create();  
                String reply = client.receiveUpdateReportStatusForApply("R2016052800001", "20");
                System.out.println("Server said: " + reply);  
            }  
}

 

posted @ 2016-05-28 16:32  Vip灬cnblog  阅读(276)  评论(0编辑  收藏  举报