FatherClassPojo is my bean containing some String
At the beginning I recieve the same exception for missing serializer from my bean.
So I change my client code to register serialized (but I don't understand why I must do it... in this way my client MUST use some WebSphere classes and so it is not anymore fully complient with every engine!!!!)
{code}
javax.xml.rpc.Service vService = createService(....);
TypeMappingRegistry vTMR = vService.getTypeMappingRegistry();
TypeMapping vTM = vTMR.createTypeMapping();
vTMR.register("", vTM);
SerializerFactory vSerializerFactory = BeanSerializerFactory.createFactory(BeanSerializerFactory.class, FatherClassPojo.class, QNAME_TYPE_FC);
DeserializerFactory vDeserializerFactory = BeanDeserializerFactory.createFactory(BeanDeserializerFactory.class, FatherClassPojo.class, QNAME_TYPE_FC);
System.out.println("vDeserializerFactory : " + vDeserializerFactory);
System.out.println("vSerializerFactory : " + vSerializerFactory);
vTM.register(FatherClassPojo.class, QNAME_TYPE_FC, vSerializerFactory, vDeserializerFactory);
{code}
If I try to use the defualt Type Mapping instead to create a new one I recieve an exception "Default type mapping cannot be modified"
I add in that why all my Serialized/Deserialized... but now the java.lang.String Serialized is not found!!! crazy
I try also to add a serializer for java.lang.String using
{code}
TypeMapping vDefaultTM = vTMR.getDefaultTypeMapping();
SerializerFactory vSerializer3Factory = vDefaultTM.getSerializer(String.class, QNAME_TYPE_String);
DeserializerFactory vDeserializer3Factory = vDefaultTM.getDeserializer( String.class, QNAME_TYPE_String);
System.out.println("vDeserializer3Factory : " + vDeserializer3Factory);
System.out.println("vSerializer3Factory : " + vSerializer3Factory);
vTM.register(String.class, QNAME_TYPE_String, vSerializer3Factory, vDeserializer3Factory);
{code}
but... without success.
At this time I try to use a Dynamic Proxy.. at the beginning I have the same issue : missing serialized for my Bean..
Add the same code to register serialized and it seems to works! (no issue related to java.lang.string Serializer)
But I recieve an unauthenticated 401 exception : my WS is a ejb 2.1 stateless session under security and I don't know how to pass credentials to it (using DII I simply set Stub.USERNAME_PROPERTY and Stub.PASSOWORD_PROPERTY properties on Call...
Any idea for this error ?
Maybe it is a bug ?
I'm using WAS 7.0.3 (latest fix.) with latest JDK 1.6 SR4+147109 into a x64 window env.
Thanks
Roberto
So using DII I must register also any String attribute, instead using d dynamic proxy, I can avoid it...
It is very strange to have a so differente behaviours. Is it a bug ? or not ?
But I'm surprise also to do it... I'm really doesn't register it directly .. I try to explain better...
{code}
QName QNAME_TYPE_FC = new QName("http://imp.abs.dat.com/", "FatherClassPojo";
.
SerializerFactory vSerializerFactory = BeanSerializerFactory.createFactory(BeanSerializerFactory.class, FatherClassPojo.class, QNAME_TYPE_FC);
DeserializerFactory vDeserializerFactory = BeanDeserializerFactory.createFactory(BeanDeserializerFactory.class, FatherClassPojo.class, QNAME_TYPE_FC);
vTM.register(FatherClassPojo.class, QNAME_TYPE_FC, vSerializerFactory, vDeserializerFactory);
{code}
I only ask to the factory to looking for the serializer / deserializer for my bean! The factory found it (FatherClassPojo_Ser and FatherClassPojo_Deser)... so why the WebSphere implementation doesn't looking for it automaticaly ? Maybe I must set a property ?
I believe it is very simple for the WAS WS client implementation to manage it..
Or maybe I make a very big mistake writing my client code ? It is possible....
Can someone give me some suggestion/opinion ?
Thanks
Roberto