Hi There,
I am stuck at a serious problem. I am new to PERL so any help will be deeply
appreciated. I have written below code to get a successful response from a WEB
Service using strawberry PERL. It worked fine.
Now my next requirement is to connect to Oracle DB from the Perl script. I
wrote one code but it was giving me some errors like - DBI not present. So my
questions are:
1. Can I access oracle using DBI module from default strawberry PERL
2. As I was reading on Google that there are some problems with DBI
module in Strawberry PERL. So I uninstalled my strawberry Perl and Installed
Active State Perl. Now even my below code has stopped working. Is says -
certificate verify failed in Active State Perl. Is there some way that the
below code can work on active state Perl also.
// PERL Code
#!/usr/bin/perl -w
use strict;
use FileHandle;
use LWP::UserAgent;
use HTTP::Request::Common;
use HTTP::Headers;
# Unset $/, the Input Record Separator, to make <> give you the whole file at
once
local $/=undef;
#Open File Handle
open (MYFILE, 'C:\Vivek
M\perlscripts\WorkSpace\CreditCustomer\CreditCustomer.xml') or die "Could not
open file\n";
my $filecontents = <MYFILE>;
close(MYFILE);
print ("<<<<< REQUEST >>>>> \n\n");
print $filecontents . "\n";
# Certificates
#$ENV{HTTPS_CA_FILE} = 'C:\AccessGateway\soapuiopenssl.pem';
$ENV{HTTPS_CERT_FILE} = 'C:\AccessGateway\soapuiopenssl.pem';
$ENV{HTTPS_KEY_FILE} = 'C:\AccessGateway\soapuiopenssl.pem';
# Proxy_basic_auth
$ENV{HTTPS_PROXY_USERNAME} = 'testprepay_90';
$ENV{HTTPS_PROXY_PASSWORD} = 'Smart421';
print("\n\n");
print ("<<<<<<< RESPONSE >>>>>>> \n\n");
# Creating and firing the request
my $userAgent = LWP::UserAgent->new();
my $request = HTTP::Request->new(POST =>
'https://dmmlw-ldom-056:10001/axis2/services/CreditCustomerService_1_0');
#$request->header('Host' => "dmmlw-ldom-056");
$request->content_type("text/xml");
$request->content_length(length($filecontents));
$request->content($filecontents);
# Getting the Response
my $response = $userAgent->request($request);
# Verifying the response
if (!$response->is_error) {
print $response->content;
print "\n";
}
else {
print $response->error_as_HTML;
}
Kind Regards,
Vivek Malhotra
ECommerce Test Services
t+44 (0) 113 202 4544
m+44 (0) 7596880793
Telefónica UK Limited
This electronic message contains information from Telefonica UK, Telefonica
Europe or Telefonica Digital which may be privileged or confidential. The
information is intended to be for the use of the individual(s) or entity named
above. If you are not the intended recipient be aware that any disclosure,
copying distribution or use of the contents of this information is prohibited.
If you have received this electronic message in error, please notify us by
telephone or email.
Switchboard: +44 (0)113 272 2000
Email: [email protected]
Telefonica UK Limited 260 Bath Road, Slough, Berkshire SL1 4DX Registered in
England and Wales: 1743099. VAT number: GB 778 6037 85
Telefonica Europe plc 260 Bath Road, Slough, Berkshire SL1 4DX Registered in
England and Wales: 05310128. VAT number: GB 778 6037 85
Telefonica Digital Limited 260 Bath Road, Slough, Berkshire SL1 4DX Registered
in England and Wales: 7884976. VAT number: GB 778 6037 85