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

Passing array of objects Axis Client-Perl WS failed?

Expand Messages
  • Arthur Christoph
    Hi all, I just basically try to return the array of ClassB itself as the return value but failed. Anyone has any thoughts on this one or if anyone has
    Message 1 of 1 , Aug 15 3:58 PM
    • 0 Attachment
      Hi all,
      I just basically try to return the array of ClassB itself as the return value but failed. Anyone has any thoughts on this one or if anyone has successfully done it? Java codes are generated using WSDL2Java. Thank you.
       
      in Perl WS code:
      sub sendParamArrayOfClassB{
       my $self = shift;
       my $arrB = shift;
       return $arrB;
      }
      in Java Client code:
      ClassB aB = new ClassB();
        aB.setI(0);
        aB.setS("b");
      ClassB[] arrB = new ClassB[]{aB, aB};
        ClassB[] arrBparam = port.sendParamArrayOfClassB(arrB);
        System.out.println(arrBparam[0].getI());

      The error message that I got:
      Cannot assign object of type WS.ClassB[][] to an object of type WS.ClassB[]

      The schema snippet looks like this:

      <

      s:complexType name="ClassB">
      <s:sequence>
      <s:element minOccurs="1" maxOccurs="1" name="i" type="s:int" />
      <s:element minOccurs="1" maxOccurs="1" name="s" type="s:string" />
      </s:sequence>
      </s:complexType>

      <s:complexType name="ArrayOfClassB">
      <s:complexContent mixed="false">
      <s:restriction base="soapenc:Array">
      <s:attribute wsdl:arrayType="tns:ClassB[]" ref="soapenc:arrayType" />
      </s:restriction>
      </s:complexContent>
      </s:complexType>
    Your message has been successfully submitted and would be delivered to recipients shortly.