Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7810879
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T03:57:16+00:00 2026-06-02T03:57:16+00:00

I’m trying to add password digest WS-Security bits to web service calls from my

  • 0

I’m trying to add password digest WS-Security bits to web service calls from my client using WSS4J. I generated the client classes from the WSDL using Axis’ WSDL4J and followed the instructions for adding WS-Security’s “Password Digest” headers to the SOAP message using WSS4J, but return with the error message, “An error was discovered processing the header”. Adding debug messages, it doesn’t look like my CallbackHandler is ever getting hit. Am I doing something very wrong? Or am I missing some setup piece that goes unexplained in the WSS4J documentation?

class CSProvider {
    public CS get(CSService csService, URL url, String username)
            throws ServiceException {
        CS csPort = csService.getCSPort(url);

        ((Stub) csPort)._setProperty(WSHandlerConstants.ACTION, WSHandlerConstants.USERNAME_TOKEN);
        ((Stub) csPort)._setProperty(WSHandlerConstants.USER, username);
        ((Stub) csPort)._setProperty(UsernameToken.PASSWORD_TYPE, WSConstants.PW_DIGEST);
        ((Stub) csPort)._setProperty(WSHandlerConstants.PW_CALLBACK_CLASS, "com.example.namespace.to.PasswordCallbackHandler");

        return csPort;   
    }
}

public class PasswordCallbackHandler implements CallbackHandler {

    @Override
    public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
        for (Callback callback : callbacks) {
            if (callback instanceof WSPasswordCallback) {
                ((WSPasswordCallback) callback).setPassword(PasswordStore.getPassword());
            } else {
                throw new UnsupportedCallbackException(callback);
            }
        }
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T03:57:17+00:00Added an answer on June 2, 2026 at 3:57 am

    After much poking around, I discovered the problem. As I expected, the web service requests were going out without having been through PasswordCallbackHandler, so they were returned with the given error message from the remote server, which was expecting valid authentication credentials. What took me awhile to determine was that I needed to construct the service locator (csService, in this case) like so:

    CSService csService = new CSServiceLocator(new FileProvider("client_deploy.wsdd"));
    

    with a client_deploy.wsdd file something like the following:

    <deployment xmlns="http://xml.apache.org/axis/wsdd/" xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
        <transport name="http" pivot="java:org.apache.axis.transport.http.HTTPSender"/>
        <globalConfiguration>
            <requestFlow>
                <handler name="csHandler" type="java:org.apache.ws.axis.security.WSDoAllSender"/>
            </requestFlow>
        </globalConfiguration>
    </deployment>
    

    Then setting the properties from CSProvider.get() worked just fine.

    I had avoided a wsdd file because all the other examples I saw used it to set the username and password class — two things I won’t know until runtime. A word for the wise: when the documentation says you can use the _setProperty() methods instead of a wsdd file, it only means for the purposes of setting those properties, not replacing the file entirely.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying add a tab to my web page that looks like this: Using
I'm trying to develop a standalone Java web service client with JAX-WS (Metro) that
Trying to add the ability to delete a Folder using FTP and all subfolders
Trying to add a class object into a List using reflection, but when invoking
I'm using Flash CS4 and AS 3.0 I'm trying to add a login for
I am getting the below exception when I'm trying to add security headers to
I am trying to use Spring Security 3.0.5 in my web application. Basically, I
I'm trying to add visible text to a password field that says Enter a
I am trying to bind to AD with php_ldap (using ADLdap), from a Ubuntu
Greetings! I'm trying to add simple mail functionality to a little web app and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.