Skip to Main Content

Integration

Announcement

For appeals, questions and feedback, please email oracle-forums_moderators_us@oracle.com

DeserializationException from OC4J web service client for polymorphic type

P.E. SchmitzMay 11 2016 — edited May 11 2016

Hello!

I'm having a problem with OC4J 10.1.3.5.0. Specifically, when trying to invoke a SOAP operation which has a polymorphic type in its result, I'm getting the following exception:

unexpected element type: expected=, actual=Land

at nl.politie.fcm.bvi.ws.runtime.StamTabel__InterfaceSOAPSerializer0.doDeserialize(StamTabel__InterfaceSOAPSerializer0.java:79)

at oracle.j2ee.ws.common.encoding.InterfaceSerializerBase.deserialize(InterfaceSerializerBase.java:102)

at nl.politie.fcm.bvi.ws.runtime.ArrayOfStamTabel_LiteralSerializer0.doDeserialize(ArrayOfStamTabel_LiteralSerializer0.java:62)

at oracle.j2ee.ws.common.encoding.literal.LiteralObjectSerializerBase.internalDeserialize(LiteralObjectSerializerBase.java:250)

at oracle.j2ee.ws.common.encoding.literal.LiteralObjectSerializerBase.deserialize(LiteralObjectSerializerBase.java:159)

at nl.politie.fcm.bvi.ws.runtime.StamTabelResultaat__LiteralSerializer0.doDeserialize(StamTabelResultaat__LiteralSerializer0.java:64)

at oracle.j2ee.ws.common.encoding.literal.LiteralObjectSerializerBase.internalDeserialize(LiteralObjectSerializerBase.java:250)

at oracle.j2ee.ws.common.encoding.literal.LiteralObjectSerializerBase.deserialize(LiteralObjectSerializerBase.java:159)

at nl.politie.fcm.bvi.ws.runtime.GetStamtabelResponse__LiteralSerializer0.doDeserialize(GetStamtabelResponse__LiteralSerializer0.java:58)

at oracle.j2ee.ws.common.encoding.literal.LiteralObjectSerializerBase.internalDeserialize(LiteralObjectSerializerBase.java:250)

at oracle.j2ee.ws.common.encoding.literal.LiteralObjectSerializerBase.deserialize(LiteralObjectSerializerBase.java:159)

at nl.politie.fcm.bvi.ws.runtime.BevragingOpSignalementenSoap_Stub._deserialize_GetStamtabel(BevragingOpSignalementenSoap_Stub.java:440)

at nl.politie.fcm.bvi.ws.runtime.BevragingOpSignalementenSoap_Stub._readFirstBodyElement(BevragingOpSignalementenSoap_Stub.java:397)

at oracle.j2ee.ws.client.StreamingSender._sendImpl(StreamingSender.java:335)

at oracle.j2ee.ws.client.StreamingSender._send(StreamingSender.java:114)

at nl.politie.fcm.bvi.ws.runtime.BevragingOpSignalementenSoap_Stub.getStamtabel(BevragingOpSignalementenSoap_Stub.java:136)

The response it's trying to parse looks like this:

<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>

      <GetStamtabelResponse xmlns="http://bvi.politie.local/BevragingOpSignalementen/">

         <GetStamtabelResult>

            <lijst>

               <StamTabel xsi:type="Land">

                  <sl>-1</sl>

                  <code>Onbekend</code>

                  <nm>Onbekend</nm>

               </StamTabel>

            </lijst>

            <totaalAantalRijen>390</totaalAantalRijen>

         </GetStamtabelResult>

      </GetStamtabelResponse>

   </soap:Body>

</soap:Envelope>

This response is copied from SoapUI, where I can invoke the operation without trouble, and according to which this is a valid response. OC4J is apparently having trouble interpreting the 'xsi:type="Land"' on the StamTabel element. This type is modelled like this in the wsdl:

<s:complexType name="Land">

  <s:complexContent mixed="false">

    <s:extension base="tns:StamTabel">

      <s:sequence>

        <s:element minOccurs="1" maxOccurs="1" name="sl" nillable="true" type="s:decimal" />

        <s:element minOccurs="0" maxOccurs="1" name="code" type="s:string" />

        <s:element minOccurs="0" maxOccurs="1" name="nm" type="s:string" />

      </s:sequence>

    </s:extension>

  </s:complexContent>

</s:complexType>

<s:complexType name="StamTabel" />

I have no idea what's going wrong. Does anyone know of a known bug or limitation in OC4J which could cause this? Am I doing something wrong? Is the response wrong? In this case I would have expected the name of the element to be "Land", not "StamTabel" with an xsi:type attribute indicating the actual type; is this a correct way to encode it or could that be the problem?

I can provided more information if necessary. Thanks in advance for any help you can give!

Kind regards,

Pepijn Schmitz

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 8 2016
Added on May 11 2016
0 comments
407 views