I tried one line of code someplace somewhere
And then what happened?
"Works" for me (does everything I expect it to do )
#!/usr/bin/perl --
##
##
##
## perltidy -olq -csc -csci=3 -cscl="sub : BEGIN END if " -otr -opr -
+ce -nibc -i=4 -pt=0 "-nsak=*"
## perltidy -olq -csc -csci=10 -cscl="sub : BEGIN END if " -otr -opr
+-ce -nibc -i=4 -pt=0 "-nsak=*"
#!/usr/bin/perl --
use strict;
use warnings;
use SOAP::Lite;
Main( @ARGV );
exit( 0 );
sub Main {
my $soap = SOAP::Lite->uri( 'http://127.0.0.1/MyModule' )
->proxy( 'http://127.0.0.1:1203' );
$soap->transport->add_handler( "request_send", \&pp_dump );
$soap->transport->add_handler( "response_done", \&pp_dump );
my $token = "getValidToken()";
my $service = $soap;
$service->transport->http_request->headers->push_header(
'Authorization' => $token );
print "web method : ", $service->getLicenseSummaryInfo(), "\n";
} ## end sub Main
sub pp_twig {
use XML::Twig;
open my( $fh ), '>', \my $str;
no warnings 'newline';
XML::Twig->new( qw! pretty_print record ! )->xparse( @_ )->print(
+$fh );
return $str;
} ## end sub pp_twig
sub pp_dump {
my $content = $_[0]->content( '' );
$_[0]->content( pp_twig( $content ) );
print $_[0]->as_string, "\n";
return;
} ## end sub pp_dump
__END__
POST http://127.0.0.1:1203 HTTP/1.1
Accept: text/xml
Accept: multipart/*
Accept: application/soap
Authorization: getValidToken()
User-Agent: SOAP::Lite/Perl/1.11
Content-Length: 441
Content-Type: text/xml; charset=utf-8
SOAPAction: "http://127.0.0.1/MyModule#getLicenseSummaryInfo"
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope soap:encodingStyle="http://schemas.xmlsoap.org/soap/enc
+oding/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:
+soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http:/
+/www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSche
+ma-instance">
<soap:Body>
<getLicenseSummaryInfo xmlns="http://127.0.0.1/MyModule" xsi:nil="
+true"/>
</soap:Body>
</soap:Envelope>
|