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

header attribute getting swallowed...

Expand Messages
  • tdhite
    Hello, below is a code snippet that I cannot seem to find in error, but clearly it is. The attribute on the header *never* serializes, so I end up with the
    Message 1 of 1 , Aug 22 2:34 PM
    • 0 Attachment
      Hello,

      below is a code snippet that I cannot seem to find in error, but
      clearly it is. The attribute on the header *never* serializes, so I
      end up with the header provided below.

      Any suggestions would be greatly appreciated.

      Thanks so much.

      --- code snippet start ---
      my $version = '1.8';
      my $userID = 'myuserid';
      my $sessionID = 'mysession';

      my @headerstruct = (
      SOAP::Header->name('sessionid' => $sessionID),
      SOAP::Header->name('version' => $version)->type('string')
      );

      my $header = SOAP::Header
      ->name('headerStruct' => \SOAP::Header->value(@headerstruct))
      ->attr({'id' => $userID});

      # create the soap object
      my $soap = new SOAP::Lite;
      $soap->uri($uri);
      $soap->proxy(@proxy[2]);

      my $response = $soap->logout($header);
      --- code snippet end ---

      --- header snippet start ---
      <SOAP-ENV:Header>
      <headerStruct>
      <sessionid xsi:type="xsd:string">mysession</sessionid>
      <version xsi:type="xsd:string">1.8</version>
      </headerStruct>
      </SOAP-ENV:Header>
      --- header snippet end ---
    Your message has been successfully submitted and would be delivered to recipients shortly.