I am using java 1.4 . axis2 version is 1.5.6 . What I want to do is to add username and password to htt_request_header while sending data to web service developed with JAX-WS RI 2.2.9.
I want to add two items in Headers tab in SOAP screenshot.
I am using java 1.4 . axis2 version is 1.5.6 . What I want to do is to add username and password to htt_request_header while sending data to web service developed with JAX-WS RI 2.2.9.
I want to add two items in Headers tab in SOAP screenshot.
The problem's been solved. Since the wsdl address was created as https, it was fixed as http in the stub file and the header was added with the following method.
ServiceClient serviceClient = stub._getServiceClient(); List headers = (List) serviceClient.getOptions().getProperty(HTTPConstants.HTTP_HEADERS);
if (headers == null){
headers = new ArrayList(); } headers.add(new Header("username", username)); headers.add(new Header("password", password)); serviceClient.getOptions().setProperty(HTTPConstants.HTTP_HEADERS, headers);