#perl!
use warnings;
use strict;
use XML::Compile::SOAP;
use XML::Compile::SOAP11;
use XML::Compile::WSDL11;
use XML::Compile::Transport::SOAPHTTP;
use Data::Dumper;
##my other variables pointing to wsdl and xsd files.
my $url="http://myhost.com:9080/imws/services/ImpactManager/";
my %inargs_connect = (
"userName" => "xxxx",
"password" => "xxxxxxxxxx",
"imname" => "yyyyyyyyyyy",
"bufferType" => "abcd"
);
my $wsdl = XML::Compile::WSDL11->new;
$wsdl->addWSDL($wsdl_file);
$wsdl->compileCalls(address =>$url);
my ($answer, $trace) = $wsdl->call( 'Connect', %inargs_connect);
print ($answer);
the above code is printing : HASH(0x47f8b28)
in the last print statement if i use dumper, i get the below response.
print Dumper($answer);
$VAR1 = {
'outargs' => {
'connectionId' => '1557666855346'
}
};
how to parse the required values like, i need to be able to easily access 'connectionId' and '1557666855346' ?
Any ideas are welcome. Thanks in advance. Thanks, Kaushik KM.
loop through all the keys in answear = { outargs => { key1, key2 }}
output:
I hope this will help you!
is not working and is throwing error as follows: Experimental keys on scalar is now forbidden at CreateEvent.pl line 64. Type of arg 1 to keys must be hash or array (not key/value hash slice) at Create Event.pl line 64, near "}
can someone correct this please.
$answer
appears to be a hash reference, so you'd access the data using normal dereferencing techniques:Output: