Loading ...
Sorry, an error occurred while loading the content.

passing complex types to axis

Expand Messages
  • somebody8765 <martin.hajduch@assyst-intl
    hi ! i m getting following error from axis: org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in
    Message 1 of 3 , Feb 5, 2003
    • 0 Attachment
      hi !

      i'm getting following error from axis:
      <faultstring>org.xml.sax.SAXException: SimpleDeserializer
      encountered a child element, which is NOT expected, in something it
      was trying to deserialize.</faultstring>


      i have a complex type A; which contains array of complex types B (as a
      property called B_array)

      i'm receiving the complex type A from axis, and trying to pass it back

      in wsdl i can see, that the array of types B is defined like:
      <complexType name="ArrayOf_tns1_B"><complexContent><restriction
      base="soapenc:Array"><attribute ref="soapenc:arrayType"
      wsdl:arrayType="tns1:B[]"/></restriction></complexContent></complexType>

      in the soap message to the server, i can read something different:

      <B_array SOAP-ENC:arrayType="namesp4:B[1]"
      xsi:type="namesp5:ArrayOf_tns1_B"><item xsi:type="namesp4:B"/></B_array>

      (i left type B empty, to be sure that the problem is not within type B)

      however - when i set B_array property (of type A) to an empty array,
      it works
      then i can read in a soap message to the server:
      <B_array SOAP-ENC:arrayType="xsd:anyType[0]" xsi:type="SOAP-ENC:Array"/>

      i have tried a load of blessing/typemapping - no success
      i've seen in some messages here, that people are passing complex types
      to axis without any problems

      does anybody have an idea what i'm doing wrong ?
    • msanesh <anesh@hotmail.com>
      This usually means that something is not being passed with the right type. Make sure that each element of the array is being passed as the right type. It looks
      Message 2 of 3 , Feb 6, 2003
      • 0 Attachment
        This usually means that something is not being passed with the right
        type. Make sure that each element of the array is being passed as the
        right type. It looks like B is not being passed in as type B.

        Also, maptype B to right namespace.

        in your case
        my $b = bless {
        # B members
        } => 'B
        my @a = [$b];

        Hope this helps.
        Anesh.

        --- In soaplite@yahoogroups.com, "somebody8765 <martin.hajduch@a...>"
        <martin.hajduch@a...> wrote:
        > hi !
        >
        > i'm getting following error from axis:
        > <faultstring>org.xml.sax.SAXException: SimpleDeserializer
        > encountered a child element, which is NOT expected, in something it
        > was trying to deserialize.</faultstring>
        >
        >
        > i have a complex type A; which contains array of complex types B
        (as a
        > property called B_array)
        >
        > i'm receiving the complex type A from axis, and trying to pass it
        back
        >
        > in wsdl i can see, that the array of types B is defined like:
        > <complexType name="ArrayOf_tns1_B"><complexContent><restriction
        > base="soapenc:Array"><attribute ref="soapenc:arrayType"
        > wsdl:arrayType="tns1:B
        []"/></restriction></complexContent></complexType>
        >
        > in the soap message to the server, i can read something different:
        >
        > <B_array SOAP-ENC:arrayType="namesp4:B[1]"
        > xsi:type="namesp5:ArrayOf_tns1_B"><item
        xsi:type="namesp4:B"/></B_array>
        >
        > (i left type B empty, to be sure that the problem is not within
        type B)
        >
        > however - when i set B_array property (of type A) to an empty array,
        > it works
        > then i can read in a soap message to the server:
        > <B_array SOAP-ENC:arrayType="xsd:anyType[0]" xsi:type="SOAP-
        ENC:Array"/>
        >
        > i have tried a load of blessing/typemapping - no success
        > i've seen in some messages here, that people are passing complex
        types
        > to axis without any problems
        >
        > does anybody have an idea what i'm doing wrong ?
      • Martin Hajduch
        ... this was the problem, thanks ! however - i m just wondering, that even as i was mapping B to the wrong namespace, if it was empty, it was not a problem
        Message 3 of 3 , Feb 7, 2003
        • 0 Attachment
          > Also, maptype B to right namespace.

          this was the problem, thanks !
          however - i'm just wondering, that even as i was mapping B to the wrong
          namespace, if it was empty, it was not a problem (for axis)

          by the way - currently i'm not only blessing A & B types, but i have also
          to recreate all xsd:string values which contain number (since perl will
          send them as xsd:integer)
          isn't there an easy way to do this ? i mean - some function which would
          retype the whole structures using wsdl ?
          i was trying to find something but without success :(

          thanks,
          martin
        Your message has been successfully submitted and would be delivered to recipients shortly.