1
votes

I am new to webservices concept. I have generated java artifacts with WSDL provided, using Apache cxf tool in SOAPUI. But i am not sure how to set the username and password which are there in header of the SOAP request. i can see there is a classs AuthenticationInfo created with all the parameters like username and password.

please let me know how can i call that class or pass the values of username and password to the header part of the SOAP request. if I run the package with out setting these details i am getting Authentication failed error.

Please help me.

Thanks, hari

1

1 Answers

0
votes

If you are talking about passing username/password in the SOAP header as per UsernameToken profile described in WS-Security specification , CXF let's you do that using WSS4J Interceptors.

Take a look at following :

  1. CXF - WS-Security
  2. WSS4J Project

In your client you will need to add the WSS4JOutInterceptor.