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 Koen Weyn <ko...@staf.pi.be> on 2002/02/12 12:44:04 UTC

Custom deserializer

Hello all,

I have written a custom deserializer, but I can't seem to let it get used
The deserializer extends org.apache.axis.encoding.Deserializer and I install
it as follows:

MessageContext msgContext = new MessageContext(new AxisServer());
TypeMappingRegistry reg = msgContext.getTypeMappingRegistry();
QName qName = new QName	("http://www.hostname.com/","QueryServicesResult");
reg.addDeserializerFactory(qName, QueryServicesResult.class,
ProviderDeserializerFactory.getInstance());
DeserializationContext dser = new DeserializationContext(
	new InputSource(new FileReader("services_out2.xml")),
	msgContext, Message.RESPONSE);
dser.parse();

Below are the (snipped) contents of services_out2.xml. This is a response I
capped from a .NET engine I am trying to communicate with.
Does anybody have a clue why my ProviderDeserializerFactory.getDeserializer
isn't called ?

I have tried omitting the namespace, but that didn't work either.

For this sample, I could do without custom deserialization, but for other
calls I can't.

Setting the response type is an option, I only want to use when everything
else fails.

Thanks in advance,

Koen

services_out2.xml:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <soap:Body>
    <QueryServicesResponse xmlns="http://www.hostname.com/">
      <QueryServicesResult>0</QueryServicesResult>
    </QueryServicesResponse>
  </soap:Body>
</soap:Envelope>





+-------------------------------------+
+ Koen Weyn
+ Planet Internet NV
+ A: Rijnkaai 37, B-2000 Antwerpen
+ E: koenw@nospam.staf.pi.be
+ W: http://www.planetinternet.be
+-------------------------------------+