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 Jeff Greif <jg...@alumni.princeton.edu> on 2003/01/07 02:33:49 UTC

(de)serializers for message parts specified by elements, rather than types

In many .wsdl descriptions, element style of message part specification is used, e.g.,

<types>
   <schema>
      <element name="foo">
           <complexType .../>
      </element>
      <element name="bar">
           <complexType .../>
      </element>
  </schema>
</types>
<message name="foobarIn" >
    <part name="fooPart" element="foo"/>
</message>
<message name="foobarOut">
   <part name="barPart" element="bar"/>
</message>
<portType name="foobarPort">
    <operation name="foobar">
        <input message="foobarIn">
        <output message="foobarOut">
    </operation>
</portType>

typically, in document/literal web services.  The complex type for foo or bar might be anonymous or might be global and named.

I know how, for apache axis or soap, to specify serializer/deserializer pairs for parts that have a named type, using Call.registerTypeMapping and SoapMappingRegistry.mapTypes, respectively.  Is there some way to specify something similar when there is only an element to work from?

Typically what I do for complex types is to use a single java wrapper class to represent any and all of them, holding the input or output DOM Element as data, and a type name if one is available.  This means I have to register my standard serializer/deserializer for my wrapper class for each complex XML type that will be encountered in the parts of the input and output of the web services.  But what if the types are not named?

Thanks for any suggestions.

Jeff