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

  • Home
  • SEARCH
  • 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 9219829
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T03:12:20+00:00 2026-06-18T03:12:20+00:00

I have to write a JAX-RPC SOAP message Handler in Java 4, and I

  • 0

I have to write a JAX-RPC SOAP message Handler in Java 4, and I need to add a security header to the message.

At present, when I try to send a message I get a java.lang.AbstractMethodError: org.apache.axis.message.SOAPHeader.addHeaderElement(Ljavax/xml/namespace/QName;)Ljavax/xml/soap/SOAPHeaderElement; error.

I can’t find much online for this error, so any help would be greatly appreciated!

My code is below:

public final boolean handleRequest(MessageContext context) {
    SOAPMessageContext soapContext = (SOAPMessageContext) context;
    String authId = "test";
        try {
            SOAPMessage soapMsg = soapContext.getMessage();
            SOAPEnvelope soapEnv = soapMsg.getSOAPPart().getEnvelope();
            SOAPHeader soapHeader = soapEnv.getHeader();
            /* If no header, add one */
            if (soapHeader == null) {
                soapHeader = soapEnv.addHeader();
            }

            /* Add a soap header, name as AUTH_ID_KEY */
            QName qname = new QName(TARGET_NAMESPACE, AUTH_ID_KEY);
            SOAPHeaderElement soapHeaderElement = soapHeader.addHeaderElement(qname);
            soapHeaderElement.addTextNode(authId);
            soapMsg.saveChanges();
        } catch (SOAPException e) {
            throw new ProtocolException(e);
        }

    return true;
}

Thank you for any help!

  • 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-18T03:12:21+00:00Added an answer on June 18, 2026 at 3:12 am

    So org.apache.axis.message.SOAPHeader implements javax.xml.soap.SOAPHeaderbut keeps the addHeaderElement(QName) method abstract.

    When using this implementation then, I had to use the addHeaderElement(javax.xml.soap.Name) method instead.

    The final working code is below:

    SOAPMessage soapMessage = soapContext.getMessage();
    SOAPEnvelope soapEnvelope = soapMessage.getSOAPPart().getEnvelope();
    SOAPHeader soapHeader = soapEnvelope.getHeader();
    /* If no header, add one */
    if (soapHeader == null) {
        soapHeader = soapEnvelope.addHeader();
    }
    
    /* Add a soap header, name as AUTH_ID_KEY */
    Name name = soapEnvelope.createName(AUTH_ID_KEY);
    SOAPHeaderElement soapHeaderElement = soapHeader.addHeaderElement(name);
    soapHeaderElement.addTextNode(authId);
    soapMessage.saveChanges();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a REST api written with JAX-RS, and I need to add authentication
i have write a hash code covert method in spring security. In that method,
I have write below code String strId = 1,2 try { myDB = myDbHelper.openDataBase();
I have a Firefox extension need to write to one files inside the extension's
In SQL Server 7.0, I need to find out which users have write access
How should i parse SOAP response? Do i have to write LogicalHandler (like here
I have write code for get GPS data and print it in Toast message.
I need your help. I have write my own custom NSOperation class called GetNewsOperation.
I have write hibernate createcriteria function in my project like this Hibernatesession.createCriteria(Salesman.class).add(Restrictions.ilike(email, email)).list(); The
I have write this code but it does work only if I am already

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.