How to consume/call/invoke the SOAP web service which has HttpBasicAuthentication in Java

10,908

I.Third party tools to consume the WebServices in your Web Applications are

  1. Axis
  2. Apache-cxf
  3. Apache-Rampart (For Axis Security)

All you need to do is pass the WSDL URL to any of the utilities,and it will give client stubs, those you can use it in your Web Application.

II.Since your are using java6,it is having wsgen and wsimport utilities for WebServices,you can have any scripts (say ANT scripts) to invoke appropriate java6 utility.

III. More simply, you can generate the WebSerivce client stubs from Eclipse itself.Later you can copy the packages of client and required JAR's in classpath in your WebApplication

For Eclipse WS client : http://www.eclipse.org/webtools/jst/components/ws/1.5/tutorials/WebServiceClient/WebServiceClient.html

Share:
10,908

Related videos on Youtube

Bhavesh Patel
Author by

Bhavesh Patel

Updated on June 04, 2022

Comments

  • Bhavesh Patel
    Bhavesh Patel almost 2 years

    I need your help. We are developing one web based application. Data to be displayed on the web pages (built on HTML5 JSP) are coming from the SOAP web services. We have all the SOAP web service which has HttpBasicAuthentication, that means when we access the web service we need to pass the username and password (i.e. authentication required for web service access). Can you please suggests how to call the web service from my web application ? Do we need to use any third party frameworks like Axis2... etc ? Please note, we are using HTML5, JSP, Java6, Tomcat 6 and Eclipse as development environment.

    Appreciate your quick help.

    Thanks in advance.

  • Bhavesh Patel
    Bhavesh Patel over 11 years
    Thanks Murugesh for your reply. As I said earlier, I have web service which has HttpBasicAuthentication which requires username and password to access it. When I generate the stub by using Axis2, there is no place where I can put the username and password to hit the web service. Can you please help me on that ?
  • Murugesh
    Murugesh over 11 years
    Check on this link wiki.servicenow.com/…