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

new SOAP::Header(name => value) != SOAP::Header->name(name => value)???

Expand Messages
  • Jason Bodnar
    Hi, I used stubmaker.pl to make a wrapper of eBay s WSDL. I have to add some custom SOAP headers to authenticate with eBay so I m using the SOAP header module
    Message 1 of 1 , Jun 29, 2005
    • 0 Attachment
      Hi,

      I used stubmaker.pl to make a wrapper of eBay's WSDL. I have to add some
      custom SOAP headers to authenticate with eBay so I'm using the SOAP header
      module like so:

      my $dev_id = new SOAP::Header('ebl:DevId' => DEV_ID);
      my $app_id = new SOAP::Header('ebl:AppId' => APP_ID);
      my $auth_cert = new SOAP::Header('ebl:AuthCert' => AUTH_CERT);
      my $credentials = new SOAP::Header('ebl:Credentials' => [$dev_id, $app_id,
      $auth_cert]);
      *** my $auth_token = SOAP::Header->name('ebl:eBayAuthToken' => AUTH_TOKEN);

      *** my $header = SOAP::Header->name('ebl:RequesterCredentials' =>
      [$auth_token, $credentials]);
      $header->attr({'xmlns:ebl' => 'urn:ebay:apis:eBLBaseComponents'});

      my $eBay = new eBayAPIInterfaceService;
      my $result = $eBay->GeteBayOfficialTime(@parameters,$header);

      Notice the two lines beginning with ***. I have to use SOAP::Header->name()
      for them. If I use new SOAP::Header() like I do in the four previous lines the
      SOAP header ends up being empty. Why? Shouldn't new SOAP::Header(name =>
      value) be the same as SOAP::Header->name(name => value)?

      Thanks,

      Jason

      --
      Jason Bodnar
      jason@...
      http://www.shakabuku.org

      "You want free speech? Let's see you acknowledge a man whose words make
      your blood boil who is standing center stage advocating at the top of
      his lungs that which you would spend a lifetime opposing at the top of
      yours." -- President Andrew Shephard, "The American President"
    Your message has been successfully submitted and would be delivered to recipients shortly.