简体   繁体   中英

how can I Set username and password in SOAP request using apache cxf artifacts

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM