0 Replies Latest reply: Jul 29, 2010 2:21 AM by 592320 RSS

    complex types with single array type element, marshaling exception

    592320
      For our JAXRPC web service, we have a complex type, as follows:

      <xs:complexType name = "SomeFault">
      <xs:sequence>
      <xs:element name = "errorMessages" type="some:ErrorMessageWSType" minOccurs="0" maxOccurs="unbounded" />
      </xs:sequence>
      </xs:complexType>

      <xs:simpleType name = "ErrorMessageWSType">
      <xs:restriction base = "xs:NMTOKEN">
      <xs:enumeration value = "INVALID_1"/>
      <xs:enumeration value = "INVALID_2"/>
      <xs:enumeration value = "INVALID_3"/>
      </xs:restriction>
      </xs:simpleType>


      We are running into Marshaling exceptions on the server side when the response/fault complex type has a single array type field.

      weblogic.wsee.codec.CodecException: Failed to encode
      com.bea.xml.XmlException: failed to find a suitable binding type for use in marshalling object "[Lnamespace.type.ErrorMessageWSType;@693767e9".  using schema type: t=SomeFault@http://namespace/SOME/v1 java type:namespace.type.ErrorMessageWSType[]

      If I change SomeFault, by adding another element, the error goes away.

      <xs:complexType name = "SomeFault">
      <xs:sequence>
      <xs:element name = "errorMessages" type="some:ErrorMessageWSType" maxOccurs="unbounded" />
      <xs:element name = "dummyString" type="xsd:string" minOccurs="0" />
      </xs:sequence>
      </xs:complexType>

      Am I doing something wrong during the wsdlc code generation or is this a known issue?

      <wsdlc srcWsdl="${wsdl.dir}/${wsdl.file.name}"
      destJwsDir="${gen.src.dir}/gen-src-jar"
      destImplDir="${main.src.dir}"
      packageName="${package.prefix}" type="JAXRPC">