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

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...
  • Comment on Re^2: Using SOAP::Lite, is it possible to get rid of SOAPStruct from request header XML
  • Select or Download Code

Replies are listed 'Best First'.
Re^3: Using SOAP::Lite, is it possible to get rid of SOAPStruct from request header XML
by gellyfish (Monsignor) on Sep 07, 2005 at 12:02 UTC

    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\