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

Calling methods with array parameters

Expand Messages
  • sergio_rotstein
    Folks, I think this won t be the smartest question ever posted in this newsgroup, but after trying a whole bunch of different things, I could well use some
    Message 1 of 1 , Aug 20, 2002
    View Source
    • 0 Attachment
      Folks, I think this won't be the smartest question ever posted in this
      newsgroup, but after trying a whole bunch of different things, I could
      well use some advice. I have a soap service that I'm trying to call
      from a perl client via SOAP::Lite. I have no problem calling methods
      where the parameters are simple (e.g. strings). However, some of the
      methods I need to call have more complicated parameters and the short
      of it is, I don't know how to set up the call.

      For example, the "Login" method calls for two strings, "username" and
      "password":

      $myResult = $soapHandle
      -> Login(SOAP::Data->name('username' => 'sergio'),
      SOAP::Data->name('password' => 'sergio'));

      The above example works just fine, and I can pull a run handle from
      $myResult.

      On the other hand, there's another method I need to call named
      "RunRemoteProg". This method calls for 3 parameters:

      (1) runHandle (simple string, no problemo)
      (2) name (the name of a remote program to run, also a simple string)
      (3) progParams

      It's in (3) that I get stuck. the spec states that progParams is "An
      array of "ParameterValue" structures representing the parameters
      for the remote program". A ParameterValue structure, in turn is
      defined as having a name (string) and a value ("an array of strings
      containing the parameter values").

      In short, a parameterValue is a "name + valueArray" pair, and I need
      to call my method with an array of parameterValue(s)!

      So, right now I'm stuck at:

      $myResult = $soapHandle
      -> RunRemoteProg(
      SOAP::Data->name('runHandle' => $myRunHandle),
      SOAP::Data->name('name' => $targetProg),
      SOAP::Data->name('parameters' => WHAT SHOULD GO
      HERE??);

      Also, while I'm at it, I've noticed a number of posts where people are
      showing the outgoing soap evelope, which seems to be a great way of
      diagnosing things... Is there a method that will print that out in a
      nice xml format (I've been looking at things using Data::Dumper, but
      it's not so good for this kind of thing...)?

      Thank you very much for any advice you may have.

      Regards,

      Sergio.
    Your message has been successfully submitted and would be delivered to recipients shortly.