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 toby cabot <to...@caboteria.org> on 2005/01/19 21:52:38 UTC

turn off _any parsing?

Hi Folks,

I'm using Axis and it's been going great so far, but I just noticed
something that I need to fix.  I'm using a doc/lit style and have a
wsdl document and an XSD, and Axis generates Java classes for me.  So
far, so good, the service works great *until* the client adds an XML
element that's not in the schema.  At that point I can no longer
serialize the Axis-generated classes because somewhere in the
org.apache.axis.message.MessageElement (or one of its contained
classes) that's in the _any field there are java.lang.reflect.Methods
which aren't serializable.

Even if they were serializable they're big and I don't need the _any
stuff so I'm wondering if there's some way to turn the _any parsing
off and tell Axis to ignore elements that aren't in the schema.  I
don't see any such options to WSDL2Java but maybe I've missed
something.

Any help appreciated.

Toby

Re: turn off _any parsing? (workaround)

Posted by toby cabot <to...@caboteria.org>.
On Wed, Jan 19, 2005 at 03:52:38PM -0500, toby cabot wrote:
> Even if they were serializable they're big and I don't need the _any
> stuff so I'm wondering if there's some way to turn the _any parsing
> off and tell Axis to ignore elements that aren't in the schema.

Still haven't found what I was looking for, but as a workaround it
seems to work OK to wash the Axis-generated classes through an Ant
filter to change the _any fields to transient:

Have wsdl2java put its output in build/generate-axis-raw, then:

 <copy toDir="build/generate-axis">
   <fileset dir="build/generate-axis-raw">
     <include name="**/*.java" />
   </fileset>
   <filterset begintoken="p" endtoken=";">
     <filter token="rivate org.apache.axis.message.MessageElement [] _any" 
      value="private transient org.apache.axis.message.MessageElement [] _any;"/>
   </filterset>
 </copy>