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

Re: help with arrays

Expand Messages
  • eric-amick@comcast.net
    ... It s being received fine. If you look at the output, you ll see that you get a *reference* to the array. Change my @vars = @_; to my $vars = shift; and
    Message 1 of 2 , Mar 24, 2004
    • 0 Attachment
      > The following is the incoming SOAP message (pay attention to the
      > metadata tag which is an array of strings)
      >
      >
      > <?xml version="1.0" encoding="UTF-8"?>
      > <soapenv:Envelope
      > xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
      > xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      > <soapenv:Body>
      > <ns1:updateTagValue
      > soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      > xmlns:ns1="AliEn/Service/Interface">
      > <directory
      > xsi:type="xsd:string">/mammogrid/oxford/patients/patCL-005</directory>
      > <tagname xsi:type="xsd:string">PatientsV0</tagname>
      > <metadata xsi:type="soapenc:Array" soapenc:arrayType="xsd:string[3]"
      > xmlns:ns2="http://xml.apache.org/xml-soap"
      > xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
      > <item>PatientId=CL-005</item>
      > <item>Gender=F</item>
      >
      > <item>EncryptedDateOfBirth=4270bbaeebe841e016107a8deba3da039580e5b2673f183746132
      > 586ae9ebc54eceb3a494b9c16d9d1f791eefd13190052e65b0738de2c8448d45a1ecf8736092741f
      > 6a066448ed1bc99f3413e935ced6926ad19ace48c621d924a4b6b71f55fd97f08a302cea56a14a9a
      > 56177f67b9bf2a8419c5699741c117b50e3d9be2a3a</item>
      > </metadata>
      > </ns1:updateTagValue>
      > </soapenv:Body>
      > </soapenv:Envelope>
      >
      >
      >
      >
      > On the perl end -
      >
      > sub updateTagValue
      > {
      > my $this = shift;
      > my $directory = shift;
      > my $tagName = shift;
      > my @vars=@_;
      >
      > $self->{LOGGER}->info( "Interface", "Executing
      > updateTagValue($directory, $tagName, $#_, $#vars, @vars)");
      >
      >
      >
      > This prints
      >
      > Executing updateTagValue(/mammogrid/oxford/patients/patCL-005,
      > PatientsV0, 0, 0, ARRAY(0x8f8bce8))
      >
      >
      > Array size is 0. The array is not being received by perl properly...

      It's being received fine. If you look at the output, you'll see that you get a *reference* to the array. Change

      my @vars = @_;

      to

      my $vars = shift;

      and change the print to

      $self->{LOGGER}->info( "Interface", "Executing
      updateTagValue($directory, $tagName, $#_, $#{$vars}, @$vars)");

      and I believe you'll see what you want.

      --
      Eric Amick
      Columbia, MD
    Your message has been successfully submitted and would be delivered to recipients shortly.