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 5841707
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T11:55:27+00:00 2026-05-22T11:55:27+00:00

I have some Java code that takes an XML (SOAP) message and returns the

  • 0

I have some Java code that takes an XML (SOAP) message and returns the deserialized object:

public static <T> T deserializeObject(String xml, Class<T> clazz) throws AxisFault, Exception {
    assert xml != null : "xml != null";
    assert clazz != null : "clazz != null";

    T result = null;
    try {
        Message message = new Message(SOAP_START + xml + SOAP_END);
        result = (T)message.getSOAPEnvelope().getFirstBody().getObjectValue(clazz);
    } catch (Exception e) {
        // most likely namespace error due to removed namespaces
        Message message = new Message(SOAP_START_XSI + xml + SOAP_END);
        result = (T)message.getSOAPEnvelope().getFirstBody().getObjectValue(clazz);
    }
       return result;
    }

However this code only works with Axis 1.4 🙁 Could someone Help me have that code work with Axis 2?

In fact, I might just need to know what to replace the import org.apache.axis.Message with?
Thanks in advance.

  • 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-05-22T11:55:28+00:00Added an answer on May 22, 2026 at 11:55 am

    Every message within the Axis2 engine is wrapped inside a MessageContext object. When a SOAP message arrives into the system or is prepared to be sent out, we create an AXIOM object model of the SOAP message.

    (Please read the AXIOM article series for more information on AXIOM). This AXIOM model is then included inside the message context object. Let’s see how to access this SOAP message inside Axis2.

    // if you are within a handler, reference to the message context 
    MessageContext messageContext; 
    

    object will be passed to you through Handler.invoke(MessageContext) method.

    SOAPEnvelope soapEnvelope = messageContext.getEnvelope();
    

    please see :
    javax.xml.soap
    Interface SOAPEnvelope

    Processing Axis2 message

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

Sidebar

Related Questions

Let's say I have some Java code: public class SomeClass { static { private
I have to take over and improve/finish some code that transforms Java objects from
I have some Java code that uses curly braces in two ways // Curly
I have a standalone Java app that has some licensing code that I want
I have to ship some groovy code to some users that have only java
I have ported some LGPL code from Java to C#, which I plan to
Does anyone have a good solution for integrating some C# code into a java
I have a java server that sends some data through a socket to a
Some Java mobile devices have distinct heaps for MIDP and VM. What's the distinction
I have some model objects I'm using in my Java client application. Later these

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.