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

Passing list of integers to MS .NET (scalars work fine)

Expand Messages
  • Chris Davies
    Well, here I am again. After tearing what s left of my hair out for the past several hours I have come to the conclusion that it s time to ask the experts :-)
    Message 1 of 1 , Jul 3, 2001
    • 0 Attachment
      Well, here I am again. After tearing what's left of my hair out for the past
      several hours I have come to the conclusion that it's time to ask the
      experts :-)

      I can successfully communicate between my SOAP::Lite (version 0.50) client
      and an MS .NET server using various different functions. It's all hunky dory
      and works a treat, except for the one function that requires a list of
      integers.

      The error message shows that the server function has been defined as
      "...SetCarOptions(String VehicleId, Int32[] Id)"

      So, I've built a function that's supposed to pass these parameters. Here's
      the relevant snippet of client code (where $vehicleId and @optionIds are the
      data items corresponding to the function's parameter definitions):

      my $xVehicleId = SOAP::Data
      -> type ("string")
      -> name ("~:VehicleId")
      -> value ($vehicleId)
      ;
      my $xIds = SOAP::Data
      -> type ("Array")
      -> name ("~:Id")
      -> value ([ map { SOAP::Data
      -> type ("int")
      -> value ($_)
      } @optionIds ])
      ;
      my $xOut = $soap->SetCarOptions ($xVehicleId, $xIds);

      Unfortunately I get a soap fault from the server,
      "System.NullReferenceException: Attempted to dereference a null object
      reference", and the folks writing the server can't offer any assistance.

      In the good tradition of desperate programmers, I've experimented with
      various combinations -
      * SOAP::Data ref to list of SOAP::Data data items (as coded above)
      * reference to simple list of data items (i.e. \@optionIds)
      * simple list of SOAP::Data data items (i.e. @optionIds)
      * reference to simple list of SOAP::Data data items (fun with "map")
      * SOAP::Data ref to simple list of data items (i.e. SOAP::Data -> type
      ("int") -> value (@optionIds))
      * SOAP::Data ref to reference containing list of data items (i.e.
      SOAP::Data ([ @optionIds ]))
      but none of these result in a happy server.


      Here's the actual XML/Soap message being transmitted - formatted for "easy"
      reading, of course --

      <SOAP-ENV:Envelope
      xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
      xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:xsd="http://www.w3.org/1999/XMLSchema"
      SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
      <SOAP-ENV:Body>
      <namesp1:SetCarOptions xmlns:namesp1="http://tempuri.org/">
      <namesp1:VehicleId
      xsi:type="xsd:string">0006F5C4-0000-0000-0000-0000000F4369</namesp1:VehicleI
      d>
      <namesp1:Id xsi:type="SOAP-ENC:Array"
      SOAP-ENC:arrayType="xsd:int[2]">
      <item xsi:type="xsd:int">7</item>
      <item xsi:type="xsd:int">49</item>
      </namesp1:Id>
      </namesp1:SetCarOptions>
      </SOAP-ENV:Body>
      </SOAP-ENV:Envelope>


      Do any of you have any suggestions at all, please?

      Thanks!
      Chris
      --
      Chris Davies, Manheim Interactive (Europe)
      Tel. 0870 444-0450 Fax. 0870 444-0482 Email. MOL@...
    Your message has been successfully submitted and would be delivered to recipients shortly.