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 Jason McCormick <jm...@lexi.com> on 2004/02/19 22:42:52 UTC

QName identifiers for custom serialization

Hello all,

  I'm working through a webservice that is littered with objects that 
require customer serializers.  I have all of the serializers written, 
but I'm a little unclear as to how to name them in the .wsdd and how to 
use them in the client code.  For example an object of User, I'm 
currently calling "User" as the namespace.  For example:

<typeMapping
	xmlns:ns="urn:Server"
        qname="ns:User"
        type="java:com.lexi.publish.publishobjects.User"
        serializer="com.lexi.publish.ser.UserSerFactory"
        deserializer="com.lexi.publish.ser.UserSerFactory"
        encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
/>

And inside of client code:

QName UserMap = new QName("urn:Server", "User");
c.registerTypeMapping(
	User.class, 
	UserMap,
	new UserSerFactory(User.class, UserMap),
	new UserDeserFactory(User.class, UserMap)
);
c.addParameter("user", UserMap, ParameterMode.IN);

Are both of these code snippets appropriate?  Specifally the qname 
attribute in the <typeMapping> combined with the QName object inside of 
the code.  I'm not sure where/when/if it's appropriate to use ns:

Thanks
-- Jason