File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes setting username and password Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Web Services
Reply Bookmark "setting username and password" Watch "setting username and password" New topic
Author

setting username and password

dale con
Ranch Hand

Joined: Apr 15, 2005
Posts: 93
hi all

i'm currntly getting username and password using basic authentication in my web service.

we are using a product that doesn't support http basic authentaication in the http header, so now i have to re-write my web service. Can anyone suggest an alternative way to do this?

Can i set the username and password in the SOAP Envelope/body?

Thsi is the code i'm curently using
String headerAuth = (String)msgContext.getProperty(HTTPConstants.HEADER_AUTHORIZATION);

if (headerAuth != null)
{
headerAuth = headerAuth.trim();
}

if (headerAuth != null && headerAuth.startsWith("Basic "))
{
int i;

headerAuth = new String(Base64.decode(headerAuth.substring(6)));

String [] userNamePassword = headerAuth.split(":");

userName = userNamePassword[0];
password = userNamePassword[1];
}

thanks for any help
 
 
subject: setting username and password
 
Threads others viewed
Microsoft Sharepoint web service from Java client
Microsoft Sharepoint web services from java client
Accessing secure web pages with JTextPane
Finishing Driver Help, Null error
Basic authentication soap header values?
IntelliJ Java IDE