You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Samuel Solon <Sa...@intervoice.com> on 2004/12/16 00:08:01 UTC

Element with type="xsd:any"

I'm using WSDL to define messages that have one (or more) elements
containing arbitrary XML and I'm running into problems.

I tried:

      <xsd:complexType name="AddContact">
        <xsd:sequence>
          <xsd:element name="UserId" type="xsd:string"/>
          <xsd:element name="AbookId" type="xsd:string"/>
          <xsd:element name="Contact" type="xsd:any"/>
        </xsd:sequence>
      </xsd:complexType>

Where the "Contact" element can contain arbitrary XML but WSDL2Java
generates references to

                       private org.w3.www._2001.XMLSchema.Any contact;

which doesn't seem to exist.

Is defining an element like this (type="xsd:any") even legal?

I couldn't find any support for this form in the code but I did hack an
AnyDeserializer and mapped it to this type and it works as I wanted.

Sam


Re: Element with type="xsd:any"

Posted by Jeff Greif <jg...@alumni.princeton.edu>.
xsd:any is not a defined type.  You probably mean xsd:anyType.
----- Original Message ----- 
From: "Samuel Solon" <Sa...@intervoice.com>
To: <ax...@ws.apache.org>
Sent: Wednesday, December 15, 2004 3:08 PM
Subject: Element with type="xsd:any"


I'm using WSDL to define messages that have one (or more) elements
containing arbitrary XML and I'm running into problems.

I tried:

      <xsd:complexType name="AddContact">
        <xsd:sequence>
          <xsd:element name="UserId" type="xsd:string"/>
          <xsd:element name="AbookId" type="xsd:string"/>
          <xsd:element name="Contact" type="xsd:any"/>
        </xsd:sequence>
      </xsd:complexType>