You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@ws.apache.org by Pete Roth <pr...@telemetrytech.net> on 2001/08/03 18:43:53 UTC

Setting (mapping) deserializers to deserialize a complex response with nested elements

I am having trouble setting up deserializers for the SOAP response listed
below.  If anyone could help me I would greatly appreciate it.  

I am using the latest Apache Java libraries and connecting to a .NET beta 2
MS server.  I have successfully written a Java client to use a simple Add
function which only returns one element in the result XML element.  The
method I am using now returns the below XML.  In the result element there
are three elements those elements also containing nested elements.  

When I use the standard code, listed in the Apache user manual (under user
guide/Interoperability), to set custom mappings for dealing with the
"xsi:type" not being included with the .NET response.  I have no problems
with a simple one element returning method.  The problem is when I try to
set deserializers for each element in another method which has the response
listed below.  

If I add StringDeserializers for each attribute and element in the below XML
in my client I still get the dreaded, "no serializer found to deserialize a
"myNameSpace:device_getCurrentMessageResult".  That is the element (in the
below listing) which contains the three other elements.  Even if I add a
StringDeserializer for "device_getCurrenMessageResult" I still get the same
error.  If I only add a StringDeserializer for the
"device_getCurrenMessageResult" I still get the error.

Can anyone help me with how to correctly setup the deserializers for a
response like the one below?  Remember I need to manually add to the
SOAPMappingRegistry since I am using a .NET server with the Apache libraries
which require "xsi:type" normally.

Thank you for any help. 

**********************
SOAP Response Envelope
****************************************************************************
**************

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <device_getCurrentMessageResponse
xmlns="http://telemetrytech.net/VnocngWebService">
      <device_getCurrentMessageResult>
        <vnVNOC ThisTransactionTime="string">
          <VnocAddress>string</VnocAddress>
          <UserAddress>string</UserAddress>
          <Disclaimer>string</Disclaimer>
          <Copyright>string</Copyright>
        </vnVNOC>
        <vnDevice AccountID="string" DeviceIDInternal="int"
AdminLevelAccess="boolean" AccountIDInternal="int">
          <GroupName>string</GroupName>
          <DeviceName>string</DeviceName>
        </vnDevice>
        <vnDeviceInboundMsg MessageID="string">
          <MessageEncoding>string</MessageEncoding>
          <MessageTime>string</MessageTime>
          <MessageTimeUTC>string</MessageTimeUTC>
          <MessageData>string</MessageData>
          <MessageDataPreParsed>string</MessageDataPreParsed>
          <MessageDataLenIn>string</MessageDataLenIn>
        </vnDeviceInboundMsg>
      </device_getCurrentMessageResult>
    </device_getCurrentMessageResponse>
  </soap:Body>
</soap:Envelope>

****************************************************************************
**************

Peter Roth
Telemetry Technologies Inc.
p: 404.231.0021 ext. 1290
e: proth@TelemetryTech.net