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

Passing an Array of Array of Strings

Expand Messages
  • Chris
    I am trying to pass an array of array of Strings from my perl program to a java based web service. I have included the snippets from the wsdl below. I tried
    Message 1 of 3 , Feb 27, 2006
    • 0 Attachment
      I am trying to pass an array of array of Strings from my perl
      program to a java based web service. I have included the snippets
      from the wsdl below. I tried just passing a array of array of
      strings, but this will not serialzie. I tried various encantations
      of SOAP:Data objects, but none would serialize correctly. So, any
      ideas, on how one could create a ArrayOfString2D object in perl that
      I can pass?

      Thanks for any help,
      Chris


      <complexType name="ArrayOfString2D">
      - <complexContent>
      - <restriction base="soapenc:Array">
      <attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:string[]
      []" />
      </restriction>
      </complexContent>
      </complexType>
      - <wsdl:message name="executeQueryRequest">
      <wsdl:part name="UNIXLogin" type="xsd:string" />
      <wsdl:part name="queryName" type="xsd:string" />
      <wsdl:part name="query" type="tns6:ArrayOfString" />
      <wsdl:part name="resultColumns" type="tns6:ArrayOfString2D" />
      </wsdl:message>
      <wsdl:operation name="executeQuery" parameterOrder="UNIXLogin
      queryName query resultColumns">
      <wsdl:input name="executeQueryRequest"
      message="impl:executeQueryRequest" />
      <wsdl:output name="executeQueryResponse"
      message="impl:executeQueryResponse" />
      </wsdl:operation>
    • Eric Bridger
      Hmmm. Are you sure that it s actually expecting an array of arrays? Just because it s called ArrayofString2D doesn t mean it is. But I d try something like: my
      Message 2 of 3 , Feb 28, 2006
      • 0 Attachment
        Hmmm. Are you sure that it's actually expecting an array of arrays?
        Just because it's called ArrayofString2D doesn't mean it is.

        But I'd try something like:

        my @vals1 = ('one', 'two', 'three');
        my @vals2 = ('four', 'five', 'six');
        my @vals = ();

        push @vals, SOAP::Data->name( ArrayofString => \@vals1);
        push @vals, SOAP::Data->name( ArrayofString => \@vals2);

        my $TwoDArray = SOAP::Data
        ->name(ArrayofString2D => \@vals);

        Producing:

        <ArrayofString2D soapenc:arrayType="soapenc:Array[2]"
        xsi:type="soapenc:Array">
        <ArrayofString soapenc:arrayType="xsd:string[3]"
        xsi:type="soapenc:Array">
        <item xsi:type="xsd:string">one</item>
        <item xsi:type="xsd:string">two</item>
        <item xsi:type="xsd:string">three</item>
        </ArrayofString>
        <ArrayofString soapenc:arrayType="xsd:string[3]"
        xsi:type="soapenc:Array">
        <item xsi:type="xsd:string">four</item>
        <item xsi:type="xsd:string">five</item>
        <item xsi:type="xsd:string">six</item>
        </ArrayofString>
        </ArrayofString2D>

        You may need to play with the SOAP::Data ->name and ->type methods to
        get the correct namespacesa and types.

        Eric


        On Tue, 2006-02-28 at 00:49, Chris wrote:
        > I am trying to pass an array of array of Strings from my perl
        > program to a java based web service. I have included the snippets
        > from the wsdl below. I tried just passing a array of array of
        > strings, but this will not serialzie. I tried various encantations
        > of SOAP:Data objects, but none would serialize correctly. So, any
        > ideas, on how one could create a ArrayOfString2D object in perl that
        > I can pass?
        >
        > Thanks for any help,
        > Chris
        >
        >
        > <complexType name="ArrayOfString2D">
        > - <complexContent>
        > - <restriction base="soapenc:Array">
        > <attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:string[]
        > []" />
        > </restriction>
        > </complexContent>
        > </complexType>
        > - <wsdl:message name="executeQueryRequest">
        > <wsdl:part name="UNIXLogin" type="xsd:string" />
        > <wsdl:part name="queryName" type="xsd:string" />
        > <wsdl:part name="query" type="tns6:ArrayOfString" />
        > <wsdl:part name="resultColumns" type="tns6:ArrayOfString2D" />
        > </wsdl:message>
        > <wsdl:operation name="executeQuery" parameterOrder="UNIXLogin
        > queryName query resultColumns">
        > <wsdl:input name="executeQueryRequest"
        > message="impl:executeQueryRequest" />
        > <wsdl:output name="executeQueryResponse"
        > message="impl:executeQueryResponse" />
        > </wsdl:operation>
        >
        >
        >
        >
        >
        >
        >
        > Yahoo! Groups Links
        >
        >
        >
        >
        >
      • Eric Bridger
        One final note: $service = SOAP::Lite- proxy( .. ); .... print $service- transport- http_request- content() . n to examine what SOAP::Lite is sending.
        Message 3 of 3 , Feb 28, 2006
        • 0 Attachment
          One final note:
          $service = SOAP::Lite->proxy('..');

          ....

          print $service->transport->http_request->content() . "\n"

          to examine what SOAP::Lite is sending.

          On Tue, 2006-02-28 at 10:08, Eric Bridger wrote:
          > Hmmm. Are you sure that it's actually expecting an array of arrays?
          > Just because it's called ArrayofString2D doesn't mean it is.
          >
          > But I'd try something like:
          >
          > my @vals1 = ('one', 'two', 'three');
          > my @vals2 = ('four', 'five', 'six');
          > my @vals = ();
          >
          > push @vals, SOAP::Data->name( ArrayofString => \@vals1);
          > push @vals, SOAP::Data->name( ArrayofString => \@vals2);
          >
          > my $TwoDArray = SOAP::Data
          > ->name(ArrayofString2D => \@vals);
          >
          > Producing:
          >
          > <ArrayofString2D soapenc:arrayType="soapenc:Array[2]"
          > xsi:type="soapenc:Array">
          > <ArrayofString soapenc:arrayType="xsd:string[3]"
          > xsi:type="soapenc:Array">
          > <item xsi:type="xsd:string">one</item>
          > <item xsi:type="xsd:string">two</item>
          > <item xsi:type="xsd:string">three</item>
          > </ArrayofString>
          > <ArrayofString soapenc:arrayType="xsd:string[3]"
          > xsi:type="soapenc:Array">
          > <item xsi:type="xsd:string">four</item>
          > <item xsi:type="xsd:string">five</item>
          > <item xsi:type="xsd:string">six</item>
          > </ArrayofString>
          > </ArrayofString2D>
          >
          > You may need to play with the SOAP::Data ->name and ->type methods to
          > get the correct namespacesa and types.
          >
          > Eric
          >
          >
          > On Tue, 2006-02-28 at 00:49, Chris wrote:
          > > I am trying to pass an array of array of Strings from my perl
          > > program to a java based web service. I have included the snippets
          > > from the wsdl below. I tried just passing a array of array of
          > > strings, but this will not serialzie. I tried various encantations
          > > of SOAP:Data objects, but none would serialize correctly. So, any
          > > ideas, on how one could create a ArrayOfString2D object in perl that
          > > I can pass?
          > >
          > > Thanks for any help,
          > > Chris
          > >
          > >
          > > <complexType name="ArrayOfString2D">
          > > - <complexContent>
          > > - <restriction base="soapenc:Array">
          > > <attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:string[]
          > > []" />
          > > </restriction>
          > > </complexContent>
          > > </complexType>
          > > - <wsdl:message name="executeQueryRequest">
          > > <wsdl:part name="UNIXLogin" type="xsd:string" />
          > > <wsdl:part name="queryName" type="xsd:string" />
          > > <wsdl:part name="query" type="tns6:ArrayOfString" />
          > > <wsdl:part name="resultColumns" type="tns6:ArrayOfString2D" />
          > > </wsdl:message>
          > > <wsdl:operation name="executeQuery" parameterOrder="UNIXLogin
          > > queryName query resultColumns">
          > > <wsdl:input name="executeQueryRequest"
          > > message="impl:executeQueryRequest" />
          > > <wsdl:output name="executeQueryResponse"
          > > message="impl:executeQueryResponse" />
          > > </wsdl:operation>
          > >
          > >
          > >
          > >
          > >
          > >
          > >
          > > Yahoo! Groups Links
          > >
          > >
          > >
          > >
          > >
          >
          >
          >
          >
          >
          > Yahoo! Groups Links
          >
          >
          >
          >
          >
        Your message has been successfully submitted and would be delivered to recipients shortly.