hi,
I am trying to pass custom objects / beans in JAX-RPC using
Dynamic Proxy invocation, but whenever I try this I get a
serialization error, telling me that no serializer is
registered for the custom class. I thought that JAX-RPC
should take care of generating and registering the serializer.
If I use a static client instead (generating stubs with
wscompile) everything works fine.
To get the simplest example possible of this problem, I
modified the Dynamic Proxy "Hello" example from the JWSDP
tutorial, adding a very simple HelloObject class and a
"sayHelloObject" method to the Interface and Implementation
classes.
Here is the source code for the HelloObject class:
package proxy;
public class HelloObject {
String value;
public HelloObject() {
}
public void setValue(String v) {
value = v;
}
public String getValue() {
return value;
}
public String toString() {
return "Hello Object with value: " + value;
}
}
And here is the sayHelloObject method:
public HelloObject sayHelloObject(String s) {
HelloObject ob = new HelloObject();
ob.setValue(s);
return ob;
}
If I call sayHelloObject from a static client everything works
fine, but if I run the dynamic proxy client I get the following
error:
serialization error: no serializer is registered for (null, {
http://com.test/types/MyHello}HelloObject)
at com.sun.xml.rpc.encoding.DynamicInternalTypeMappingRegistry.getSerializer(DynamicInternalTypeMappingRegistry.java:62)
at com.sun.xml.rpc.encoding.soap.SOAPResponseSerializer.initialize(SOAPResponseSerializer.java:72)
at com.sun.xml.rpc.encoding.ReferenceableSerializerImpl.initialize(ReferenceableSerializerImpl.java:47)
at com.sun.xml.rpc.client.dii.BasicCall.createRpcResponseSerializer(BasicCall.java:436)
at com.sun.xml.rpc.client.dii.BasicCall.getResponseDeserializer(BasicCall.java:410)
at com.sun.xml.rpc.client.dii.BasicCall.invoke(BasicCall.java:279)
at com.sun.xml.rpc.client.dii.CallInvocationHandler.doCall(CallInvocationHandler.java:96)
at com.sun.xml.rpc.client.dii.CallInvocationHandler.invoke(CallInvocationHandler.java:68)
at $Proxy0.sayHelloObject(Unknown Source)
at hello.HelloClient.main(Unknown Source)
CAUSE:
no serializer is registered for (null, {
http://com.test/types/MyHello}HelloObject)
at com.sun.xml.rpc.encoding.TypeMappingUtil.getSerializer(TypeMappingUtil.java:41)
at com.sun.xml.rpc.encoding.InternalTypeMappingRegistryImpl.getSerializer(InternalTypeMappingRegistryImpl.java:287)
at com.sun.xml.rpc.encoding.DynamicInternalTypeMappingRegistry.getSerializer(DynamicInternalTypeMappingRegistry.java:47)
at com.sun.xml.rpc.encoding.soap.SOAPResponseSerializer.initialize(SOAPResponseSerializer.java:72)
at com.sun.xml.rpc.encoding.ReferenceableSerializerImpl.initialize(ReferenceableSerializerImpl.java:47)
at com.sun.xml.rpc.client.dii.BasicCall.createRpcResponseSerializer(BasicCall.java:436)
at com.sun.xml.rpc.client.dii.BasicCall.getResponseDeserializer(BasicCall.java:410)
at com.sun.xml.rpc.client.dii.BasicCall.invoke(BasicCall.java:279)
at com.sun.xml.rpc.client.dii.CallInvocationHandler.doCall(CallInvocationHandler.java:96)
at com.sun.xml.rpc.client.dii.CallInvocationHandler.invoke(CallInvocationHandler.java:68)
at $Proxy0.sayHelloObject(Unknown Source)
[I am using JWSDP 1.0.01 on Windows 2000].
If anyone can let me know what I am doing wrong here I would
really appreciate it. Is Dynamic Proxy invocation not
supported with custom types? or maybe there is some bug here?
thanks,
Lila