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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T22:08:42+00:00 2026-05-17T22:08:42+00:00

I have generated a client using Axis2 framework with XMLBeans as the data binding

  • 0

I have generated a client using Axis2 framework with XMLBeans as the data binding method.
The XSD schema is the following:
<xsd:schema>
<xsd:element name="profile" type="anyType"/>
</xsd:schema>

The java object generated which takes part of the SOAP request contains getter and setter methods that allow to get and set the profile. Here is the method signature:
requestDocument.setProfile(XmlObject profile);

The problem is that even if that I have to pass several nodes as the profile and not a valid XML document, but XMLObject expects a XML document with a root node.

I need to pass:
<accounts></accounts>
<payees></payees>

Actually, the service I use expects those nodes but did not constrains them in the schema. Thus, I can’t add another root node because even if the service won’t throw any exceptions, the profile won’t be usable.

XMLBeans already adds the underlying XML tree, I mean the profile node in the request document. Thus, I can’t use it as a root node. if I add a root node, the following XML will be created
<profile>
<profile></profile>
</profile>

And I want the document be formatted as follow:
<profile>
<accounts></accounts>
<payees></payees>
</profile>

I prefer not modifying the schema of the service. I would want to know if there is a way with Axis2/XMLBeans to tackle this issue.

  • 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-17T22:08:43+00:00Added an answer on May 17, 2026 at 10:08 pm

    I find a solution that is probably a workaround and not the clean way it should be done.
    Instead of setting the profile with an XMLObject as follow:
    requestDocument.setProfile(XmlObject profile);
    I used org.w3c.dom.Node object to create the profile content. See below:
    1. Create the elements org.w3c.dom.Element to be added to the profile:
    Element accountsElt = profileDocument.createElement("accounts");
    Element payeesElt = profileDocument.createElement("payees");
    2. Create an empty profile in the document to be send to the service, note that the object is auto generated:
    requestDocument.addNewProfile();
    3. Get the empty profile and add children to its root node:
    requestDocument.getProfile().getDomNode().appendChild(accountsElt);
    requestDocument.getProfile().getDomNode().appendChild(payeesElt);

    I hope it helps.

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

Sidebar

Related Questions

I have a PHP-generated page which is displaying some data about a set of
I have a LINQ to SQL generated class with a readonly property: <Column(Name:=totalLogins, Storage:=_TotalLogins,
I have JAX-WS generate client proxys that need to connect using HTTPS. The certificate
I have written a java axis2 1.4.1 web service and .net 3.5 WCF client
I have a generated HTML page with flash content in it. I am trying
I have a generated txt file. This file has certain lines that are superfluous,
I have long tables generated by datagrid control that go beyond the page width.
I have an automatically generated XML file for the game that I run. It
I have a core file generated on a remote system that I don't have
I have a number of generated .sql files that I want to run in

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.