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 ps...@wisnovsky.net on 2005/04/07 23:30:10 UTC

Re: type mapping prolbem

Hi...I'm still working on this problem and not getting very far. I've
tracked through with the debugger and sure enough when the binding stub
first time type registration happens it doesn't find my registration, so it
goes ahead and puts the default type there instead of or in addition to my
subtype. Its almost as if its using a different registry by the time it gets
there.

This is kind of driving me nuts. Any suggestions? Again, I'm not looking for
custom serialization, only that it create a subclass of the original class
and use the existing serializer/deserializer.

Thanks,

Peter

P.S. any idea why on Windows the binding stub alone of all the generated
files gets extra ^M characters at the end of lines?

----- Original Message -----
From: "Peter Wisnovsky" <pe...@wisnovsky.net>
To: <ax...@ws.apache.org>
Sent: Tuesday, April 05, 2005 4:37 PM
Subject: type mapping registry help


> I'd like to create a facade on top of an axis-generated web service proxy
> that does some type substitutions with derived classes representing XML
> schema elements; no new content but more convenience accessors,
> particularly to help with <key> and <keyref> pointers and backpointers.
> Our web service is evolving so I don't want to precompile a library with
> hardcoded mappings. Can someone suggest a way to do this? I've tried
> accessing the type library from an override of the service createCall
> method that tries to redefine a type handler, but this doesn't seem to be
> having an effect. I've been trying to run through with the debugger butI'm
> having trouble building the current library, and the head revision doesn't
> match in these areas any more. I'll try getting the 1.2b3 code but
> figuring out usage from the debugger is kind of time consuming.
>
> This is what I tried in my subclass of the service locator:
>
>    public javax.xml.rpc.Call createCall()
>        throws ServiceException
>    {
>        Call result = (org.apache.axis.client.Call) super.createCall();
>
>        QName name = new
> javax.xml.namespace.QName("http://yaddayadda.com/schemas/pvapi/PVTypes.xsd",
> "commitment-type");
>
>        TypeMappingRegistry registry = getTypeMappingRegistry();
>        TypeMapping mapping = registry.createTypeMapping();
>        SerializerFactory ser =  BaseSerializerFactory.createFactory(
>            org.apache.axis.encoding.ser.BeanSerializerFactory.class,
>            com.yaddayadda.api.client.types.CommitmentTypeExtended.class,
>            name);
>        DeserializerFactory deser = BaseDeserializerFactory.createFactory(
>            org.apache.axis.encoding.ser.BeanDeserializerFactory.class,
>            com.yaddayadda.api.client.types.CommitmentTypeExtended.class,
>            name);
>
>        mapping.register(
>            com.yaddayadda.api.client.types.CommitmentTypeExtended.class,
>            name,
>            ser,
>            deser);
>        return result;
>    }
>
> I'm aware I probably don't want to register this on every call :-)
>
> Thanks for any help one might be able to provide,
>
> Peter
>