I have an operation that has an EndpointReference element as a return
type. As the code generator didn't detect it had a parameter and as
that parameter was a complex type that needed serialization, I
modified the generated proxy code to handle that. When returning, my
service has returned the following SOAP body:
<soapenv:Body>
<muse-op:ServiceResponse
xmlns:muse-op="http://lsd.org/wsdm/SerialTest"
xmlns:tns="http://axis2.platform.core.muse.apache.org">
<wsa:Address>http://127.0.0.1:8080/SerialTest/services/Test</wsa:Address>
<wsa:ReferenceParameters>
<muse-wsa:ResourceId
xmlns:muse-wsa="http://ws.apache.org/muse/addressing">MuseResource-2</muse-wsa:ResourceId>
</wsa:ReferenceParameters>
</muse-op:ServiceResponse>
</soapenv:Body>
The code I'm using to invoke and to parse the response are this:
Element eprElement = invoke(_ACTIONS[0],body);
serial =
SerializerRegistry.getInstance().getSerializer(EndpointReference.class);
return (EndpointReference)serial.fromXML(eprElement);
I've also tried with:
Element eprElement = invoke(_ACTIONS[0],body);
serial =
SerializerRegistry.getInstance().getSerializer(EndpointReference.class);
return (EndpointReference)handler.fromXML(eprElement);
using the handler generated for that proxy.
In both cases I get:
Exception in thread "main" java.lang.UnsupportedOperationException:
[ID = 'NoFromXML'] The XmlSerializableSerializer does not have an
implementation of fromXML() - it only knows how to convert objects
that implement XmlSerialiable to XML (using XmlSerializable.toXML()).
If you want to deserialize objects of this type from XML, you should
extend the XmlSerializableSerializer and override toXML() and
getSerializableType().
at
org.apache.muse.core.serializer.XmlSerializableSerializer.fromXML(XmlSerializableSerializer.java:51)
at org.lsd.wsdm.Serial.SerialProxy.test(SerialProxy.java:59)
at org.lsd.wsdm.Serial.SerialTest.main(SerialTest.java:39)
--
Saludos.
José Antonio Sánchez
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]