gpshute has asked for the wisdom of the Perl Monks concerning the following question:
-------------- dumper output: $VAR1 = {#!/usr/bin/perl #use strict; use LWP::UserAgent; use XML::Simple; use XML::Parser; use Data::Dumper; # this is the RPC call: $xml_file = '<?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.or +g/soap/encoding/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/so +ap/encoding/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-insta +nce" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" x +mlns:xsd="http://www.w3.org/1999/XMLSchema" > <SOAP-ENV:Header xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oa +sis-200401-wss-wssecurity-secext-1.0.xsd"> <wsse:Security SOAP-ENC:root="1"> <wsse:UsernameToken> <wsse:Username xsi:type="xsd:string"><Removed></wsse:Username> <wsse:Password xsi:type="xsd:string"><Removed></wsse:Password> </wsse:UsernameToken> </wsse:Security> </SOAP-ENV:Header> <SOAP-ENV:Body> <ns1:retrieveTrafficStats xmlns:ns1="http://service.stats.ws.waas.cisc +o.com" SOAP-ENC:root="1"> <name><removed></name> <objType>wae</objType> <trafficType>optimized</trafficType> <direction>outbound</direction> <timeframe> <startTime xsi:type="xsd:string">2010-09-27T12:00:00</star +tTime> <endTime xsi:type="xsd:string">2010-09-27T14:00:00</endTime> <frequency xsi:type="xsd:string">lasthour</frequency> <timezone xsi:type="xsd:string">utc</timezone> </timeframe> </ns1:retrieveTrafficStats> </SOAP-ENV:Body> </SOAP-ENV:Envelope>'; my $server = '<removed>'; my $port = '8443'; my $RPCPath = '/ws/TrafficStats'; my $uri = 'https://' . $server . ':' . $port . $RPCPath; my $ua = LWP::UserAgent->new; # we need to authenticate the https connection: $ua->credentials( "", "TrafficStats", "admin", "default" ); $ua->ssl_opts("verify_hostname" =>"0"); my $header = HTTP::Headers->new; $header->header('SOAPAction' => '"retrieveTrafficStats"'); # this is to define what SOAP RPC call we are making my $request = HTTP::Request->new("POST",$uri,$header ); $request->content($xml_file); my $response = $ua->request($request); print $response->content; my $output = new XML::Simple(); #my $output = new XML::Parser(Style => 'Debug'); $xmlout = $response->content; $result=$output->XMLin($xmlout); print "result dumper\n"; print Dumper($result); print "result dumper\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Extracting Values from SOAP XML
by hippo (Archbishop) on Apr 30, 2015 at 08:38 UTC | |
|
Re: Extracting Values from SOAP XML
by Anonymous Monk on Apr 30, 2015 at 08:38 UTC | |
|
Re: Extracting Values from SOAP XML
by locked_user sundialsvc4 (Abbot) on Apr 30, 2015 at 13:12 UTC |