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

4048Re: [soaplite] Adding Headers

Expand Messages
  • Byrne Reese
    Oct 20, 2004
    • 0 Attachment
      This may have something to do with the order in which the parameters
      have been assembled. When you call a service using a WSDL, then the
      first n parameters are used for the SOAP::Body where n is the number of
      parameters the operation takes as input.

      No promises here, but try this:

      my $service = SOAP::Lite
      -> service('http://host/arsys/WSDL/nb/Grid_HelpDesk');
      <http://host/arsys/WSDL/nb/Grid_HelpDesk%27%29;>

      my $header = SOAP::Header->name(AuthenticationInfo =>
      \SOAP::Header->value(
      SOAP::Header->name(password => 'PASS'),
      SOAP::Header->name(userName => 'user'),
      )
      );

      my @param = (SOAP::Data->name("Request-ID" => '00001'),$header);

      You will notice that I also tweaked the header a little bit so that it
      is constructed properly...

      woto19 wrote:

      >
      > Dear all,
      >
      > i tried to find this in recent postings but I didn't find
      > a solution that works for me ...
      >
      > So here's my question:
      >
      > I'd like to consum a WebService by WSDL. This WebService needs
      > an authentication envelope:
      >
      > <AuthenticationInfo>
      > <username>User</userName>
      > <password>Pass</password>
      > </AuthenticationInfo>
      >
      > I tried to attache a header but I did'n succed
      > as I always have some probelems getting t his
      > running:
      >
      > #!perl -w
      >
      > use SOAP::Lite (+trace => all, maptype => {});
      >
      > my $service = SOAP::Lite
      > -> service('http://host/arsys/WSDL/nb/Grid_HelpDesk');
      > <http://host/arsys/WSDL/nb/Grid_HelpDesk%27%29;>
      >
      > my $header = SOAP::Header->name(AuthenticationInfo => { password =>
      > 'PASS', userName => 'user'});
      >
      > my @param = ($header,
      > SOAP::Data->name("Request-ID" => '00001'));
      >
      > my @myresult= $service->OpGet(@param);
    • Show all 5 messages in this topic