CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
Using WSDL to access Web Service

 



kfcnhl
New User

Feb 2, 2010, 8:34 AM

Post #1 of 3 (1874 views)
Using WSDL to access Web Service Can't Post

I am attempting to access a web service with WSDL & SOAP?

Can somebody recommend a library?(SOAP:LITE or SOAP:WSDL or ...)

Please provide some examples.

I am also give an

X.509 v3 digital certificate (PKCS#12 format) file.

What is the purpose of the certificate?



Thanks a lot,

Chen


jackster
Novice

Feb 4, 2010, 7:48 AM

Post #2 of 3 (1836 views)
Re: [kfcnhl] Using WSDL to access Web Service [In reply to] Can't Post

I use LWP with XML::Simple to query a webserver using SOAP:

use strict;
use warnings;


use LWP::UserAgent;
use Data::Dumper;
use XML::Simple;

my $axlUser = 'axlUser';
my $axlPwd = 'cisco';
my $soapEnv = <<AXL;
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<axl:getCCMVersion xmlns:axl="http://www.cisco.com/AXL/1.0">
</axl:getCCMVersion>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
AXL

# Create a user agent object
my $ua = LWP::UserAgent->new;

# Create a request
my $req = HTTP::Request->new(POST => 'https://192.168.121.6/axl/');
$req->content_type('text/xml');
$req->header('Accept' => 'text/*');
$req->header('SOAPAction' => '"CUCM:DB ver=6.1"');
$req->content($soapEnv);
$req->authorization_basic($axlUser,$axlPwd);

print $req->as_string;

# Pass request to the user agent and get a response back
my $res = $ua->request($req);

# Check the outcome of the response
if ($res->{_rc} == 200){
print $res->content;
print $res;
my $XML = eval {XMLin($res->content,KeyAttr => "")};
if($@){
$res=$@;
}else{
$res=$XML;
}
print Dumper ($res);
}
else {
print $res->status_line, "\n";
}


jackster


7stud
Enthusiast

Feb 4, 2010, 4:58 PM

Post #3 of 3 (1833 views)
Re: [jackster] Using WSDL to access Web Service [In reply to] Can't Post

jackster,

Google 'code tags'. Read the first 10 results, then come back and post what you've learned.

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives