Element defined as xsd:any cannot be generated to an appropriate type of @XmlAnyElement by wsdl2java

Solution Unverified - Updated -

Issue

  • We are expecting the xsd element defined as xsd:any can be generated to an appropriate type by wsdl2java.
  • For example, we have the following xsd, as below:
<s:element minOccurs="0" maxOccurs="1" name="SomeProject">
              <s:complexType>
                <s:sequence>
                  <s:any namespace="http://redhat.com/" ></s:any>
                </s:sequence>
              </s:complexType>
            </s:element>
  • Above snippet was be generated by wsdl2java as
@XmlAnyElement(lax = true)
protected Object any;
  • Actually what we expect is it is supposed to be a concrete type, com.redhat.MyImplClass, as the namespace indicated.
  • How can be have this behaviour to get generated ?

Environment

  • Red Hat JBoss Fuse
    • 6.x
  • Apache CXF

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.