From: Tom A. <TAn...@ca...> - 2012-01-18 16:09:50
|
Hello, I'm trying to use SOAP::Lite but having trouble doing a simple request. Here's my code: ~~~~~~~~~~~~~~~~~~~~~~~~ use strict ; use warnings ; use Data::Dumper; use SOAP::Lite ; my $endpoint = 'http://hapi-dev.hoovers.com/HooversAPI-34'; my $tns = 'http://applications.dnb.com/webservice/schema/' ; my $sObj = SOAP::Lite->new(uri => $tns, proxy => $endpoint) or die "ERROR"; my $authHeader = SOAP::Header->name("tns:ApiKeyHeader" => SOAP::Header->value( SOAP::Header->name('tns:API-KEY')->value('an_api_key')->type('') )); # create data to pass as method paramaters my $params = SOAP::Data->name('ns10:uniqueId')->value('10187000000000')->type(''); # request method $sObj->call('GetCompanyDetailSimple', $params, $authHeader); warn(Dumper($sObj)); ~~~~~~~~~~~~~~~~~~~~~~~~~ When I dump the $sObj I can see in the content the message "Our service has encountered an error." I feel least confident that I've gotten the header correctly. I know in order for the request to work you need to pass the API-KEY in the header. I was hoping that someone would be able to look at the wsdl and see what I've gotten wrong. The WSDL is too big to print in this space, but it's located at: http://hapi-dev.hoovers.com/HooversAPI-34/hooversAPI/hooversAPI.wsdl Any insight you can lend would be greatly appreciated. Sincerely, Tom Andresen |