@Bean
  public WebServiceTemplate webServiceTemplate(Jaxb2Marshaller marshaller) {
    WebServiceTemplate webServiceTemplate = new WebServiceTemplate();
    webServiceTemplate.setMarshaller(marshaller);
    webServiceTemplate.setUnmarshaller(marshaller);
    webServiceTemplate.setDefaultUri("http://localhost:10308/0308-ws-objectfactory-service");

    HttpComponentsMessageSender messageSender = new HttpComponentsMessageSender();
    messageSender.setConnectionTimeout(100);
    messageSender.setMaxTotalConnections(10);
    webServiceTemplate.setMessageSender(messageSender);
    return webServiceTemplate;
  }
  private static WebServiceTemplate createWebServiceTemplate(URI defaultURI) throws SOAPException {

    SaajSoapMessageFactory messageFactory =
        new SaajSoapMessageFactory(MessageFactory.newInstance());
    messageFactory.setSoapVersion(SOAP_11);

    HttpComponentsMessageSender httpSender = new HttpComponentsMessageSender();
    httpSender.setConnectionTimeout(1200000);
    httpSender.setReadTimeout(1200000);

    Jaxb2Marshaller serviceMarshaller = new Jaxb2Marshaller();
    serviceMarshaller.setContextPath("org.apromore.model");

    WebServiceTemplate webServiceTemplate = new WebServiceTemplate(messageFactory);
    webServiceTemplate.setMarshaller(serviceMarshaller);
    webServiceTemplate.setUnmarshaller(serviceMarshaller);
    webServiceTemplate.setMessageSender(httpSender);
    webServiceTemplate.setDefaultUri(defaultURI.toString());

    return webServiceTemplate;
  }