Web服务肥皂

时间:2015-06-02 08:32:34

标签: java spring web-services soap

我尝试调用SOAP Web服务,但是如果没有控制器类,我就无法做到。这是我在名为webService2的类中的代码,执行响应时得到NullPointerException

@Service @Transactional public class webService2 {
     @Autowired
     WebServiceTemplate  webservicetemplate2;
     public com.educanet.bbb.ws.user.User get(String username) {
         System.out.println("username is :"+username);
         ListuserbyUsernameUniqueRequest request1000 = new ListuserbyUsernameUniqueRequest();
         request1000.setUsername(username);
         ListuserbyUsernameUniqueResponse resp1000 =  (ListuserbyUsernameUniqueResponse) webservicetemplate2.marshalSendAndReceive(request1000);
         //ListuserbyUsernameUniqueResponse response1000 = (ListuserbyUsernameUniqueResponse) webservicetemplate2.marshalSendAndReceive(request1000);
         System.out.println("iciiiiiiiiiiiiiii");
         com.educanet.bbb.ws.user.User domainUser =    resp1000.getUser();
         return domainUser;
     }   
}    

0 个答案:

没有答案