Andrew, Thank you for your comments but my problem is much simpler.
I simply want to get the MessageElement so I can work with the defined (and Java code generated) element as arbitrary XML while still having the advantage of the other elements in the message wrapped in generated Java objects. I wrote a trivial custom deserializer and use an XSL transformation of the generated deploy.wsdd to add typeMapping definitions as part of the Ant build process. Sam > -----Original Message----- > From: ANDREW MICONE [mailto:[EMAIL PROTECTED] > Sent: Thursday, December 16, 2004 2:52 PM > To: [EMAIL PROTECTED] > Subject: RE: Element with type="xsd:any" > > I'm not sure if this is answering your question, but let me see if I can > help out. I've successfully used WSDL's to generate most of my Axis code. > When dealing with xsd:anyType, you just need some code to correctly type > it. If you are using Java you just need a series of if-then-else > statements using instanceof to determine which deserializer to use. For > example, here content is passed in as the result of an xsd:anyType > element. I use it for handling attachments. It seems to work with either > .NET or J2EE requestors: > > public static byte[] convertToBytes(Object content) > { > content = doc.getContent(); > if(content instanceof byte[]) > dataOUT = (byte[])content; > else > if(content instanceof DataHandler) > { > DataHandler dhData = (DataHandler)content; > dataOUT = getBytesFromStream(dhData); > } else > if(content instanceof AttachmentPart) > { > AttachmentPart attch = (AttachmentPart)content; > dataOUT = > getBytesFromStream(attch.getActivationDataHandler()); > } else > { > throw new IllegalArgumentException("Could not convert to bytes > from: " + content + " Argument type is unknown!"); > } > return dataOUT; > } > > >>> [EMAIL PROTECTED] 12/16/04 09:18AM >>> > Well that explains that problem. > > If I use "anyType", I'll need some way to specify a deserializer for the > element. > > The actual deserializer is trivial, just return the MessageElement, but > is there an easy way to map the deserializer to that element? > > Actually it would be ok to treat all "anyType" the same. > > I'd like to generate everything from the WSDL definition as part of our > build process and not have to modify the resulting wsdd to add > typeMapping entries. > > Sam > > > -----Original Message----- > > From: Jeff Greif [mailto:[EMAIL PROTECTED] > > Sent: Wednesday, December 15, 2004 6:18 PM > > To: [EMAIL PROTECTED] > > Subject: Re: Element with type="xsd:any" > > > > xsd:any is not a defined type. You probably mean xsd:anyType. > > ----- Original Message ----- > > From: "Samuel Solon" <[EMAIL PROTECTED]> > > To: <[EMAIL PROTECTED]> > > 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> > > > > > > >