Q: WebService default uri java.lang.IllegalArgumentException: 'uri' must not be empty I am consuming a Soap WebService using spring WebServiceTemplate & below is the bean creation and my bean class but dont know why i am unable to get the value of Default Uri.
Can someone please help with this thing.
ServiceContext.java
        @Bean
    public Jaxb2Marshaller marshaller() {
        Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
        marshaller.setContextPath("com.canaldigital.tsi.schema.psd.psd_managecustomer.v2");        
        return marshaller;
    }


    @Bean
    public SaajSoapMessageFactory messageFactory() {
    SaajSoapMessageFactory factory=new SaajSoapMessageFactory();

    factory.setSoapVersion(SoapVersion.SOAP_12);
        return factory;
    }    

     @Bean
    public ManageService voucherService(Jaxb2Marshaller marshaller,SaajSoapMessageFactory messageFactory) {
         ManageService service = new ManageService();

        service.setDefaultUri("http://localhost:7001/CustomerService?WSDL");
        service.setMarshaller(marshaller);
        service.setUnmarshaller(marshaller);
        service.setMessageFactory(messageFactory);
        return service;
    }

ManageService.java 
    public class ManageService extends WebServiceGatewaySupport {

    try{

    System.out.println("Finalyy calllingggg service: "+getWebServiceTemplate());    
    System.out.println("WebService template URI is: ---- "+getWebServiceTemplate().getDefaultUri());


    JAXBElement<GetCustomerInfoRequestType> mustangRequst=new createGetCustomerInfoRequest(customer);


     (JAXBElement<GetCustomerInfoResponseType>) getWebServiceTemplate().marshalSendAndReceive(mustangRequst);


    }catch(Exception e){

        e.printStackTrace();

         }

    }


A: you should use @Autowired when you call your client that extends WebServiceGatewaySupport

A: Check that you don't have @Service annotation on the service.
