我尝试调用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;
}
}