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
  • 1 View
  • 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 generated a pdf file with password protection by using the following code:
At the client end, I have generated a Proxy using SvcUtil.exe and it is
I have a problem where I receive the following web service exception, using client
I have generated the client stubs using WSDLToJava. After that I have created the
I have a bunch of generated SOAP client stubs that differ between WSDL versions.
I have generated a DAL layer with Subsonic2.2 for a .NET4.0 application, using c#
I have generated a C# SharePoint Sequential Workflow project using the very handy STSDEV
I have generated using openssl mycert.pem which contents the certificate. And I converted the
I have an xsd file Foo.xsd. I tried following ways to refer it in
I have JAX-WS generate client proxys that need to connect using HTTPS. The certificate

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.