in reply to Using SOAP::Lite, is it possible to get rid of SOAPStruct from request header XML

It is difficult to be more specific without seeing the code that generated this, but I would suggest setting autotype(0) on your SOAP::Lite object before calling the method in the first place.

/J\

  • Comment on Re: Using SOAP::Lite, is it possible to get rid of SOAPStruct from request header XML
  • Download Code

Replies are listed 'Best First'.
Re^2: Using SOAP::Lite, is it possible to get rid of SOAPStruct from request header XML
by minya (Initiate) on Sep 06, 2005 at 20:35 UTC
    Thanks so much -- setting autotype was what I needed. I have another question though.
    my $service = SOAP::Lite->new(uri => $soapaction, proxy => $endpoint); my $header = SOAP::Header->new(uri => 'www.ABSNet.net'); $header->name(AuthHeader => {'UserName' => $username, 'Password' => $p +assword}); $service->autotype(0); $service->on_action(sub { return $ACTION; }); my $response = $service->AddCUSIP(SOAP::Data->name("cusip" => $input), + $header);
    Right now UserName, Password and cusip tags are not prepended with appropriate tags, so to make it work I can manually add "namesp2:" prefixes like this:
    $header->name(AuthHeader => {'namesp1:UserName' => $username, 'namesp1 +:Password' => $password}); my $response = $service->AddCUSIP(SOAP::Data->name("namesp2:cusip" => +$input), $header);
    But my feeling is that there has to be a better way. Thanks...

      You might want to spell out the header explicitly like:

      $service->autotype(0); my $header = SOAP::Header->name(AuthHeader => \SOAP::Header->value( SOAP::Header->name(Username => $username)- +>prefix('mypref'), SOAP::Header->name(Password => $password)- +>prefix('mypref'), ) )->uri('www.ABSnet.net')->prefix('mypref');
      THis appears to create the ehader in the correct form for you.

      /J\