title: Web Service soap
body: <p>I try to call a SOAP web service but I can't do it without a controller class. This is my code in a class named <code>webService2</code>, I get a <code>NullPointerException</code> when the response is executed.</p>
  
  <pre><code>@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;
       }   
  }    
  </code></pre>