Skip to main content

How to pass username/password to a secure webservice.

1 reply [Last post]
Joined: 2007-07-18

I have a servlet client that runs on glassfish and calls a secure web service; the web service runs on Sun AppServer 8.1. How do I pass the username/password to the secure web service from the servlet?


Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2005-04-25

I'm not familiar with glass fish but I guess that you will need to something like the following
in the webservice project you need to add a reference to the war that contains the servlet and that is done in the webservices.xml references and WS-Bind section (I'm using Websphere Integration developer here)
after adding a reference you will use that reference to create user name and password security token in the WS-Bind tab and then you will create a token consumer using the created tokens

on the other hand in the web.xml (the client) you will need to create a username token and then create a token generator that will be used to create the criteria to send to the webservice

This website has very good resources about java technology