) SOAP::Data=HASH(0x1b8ff90) SOAP::Data=HASH(0x1b90008)
SOAP::Data::new: ()
SOAP::Data::new: ()
SOAP::Data::new: ()
SOAP::Data::new: ()
SOAP::Data::new: ()
SOAP::Transport::HTTP::Client::send_receive: HTTP::Request=HASH(0x1b97130)
SOAP::Transport::HTTP::Client::send_receive: POST http://localhost/IVRWebServic
/Membership.asmx
Accept: text/xml
Accept: multipart/*
Content-Length: 750
Content-Type: text/xml; charset=utf-8
SOAPAction: http://www.doubleday.com.au/IsMemberValid
DoubleDayIVRWebServices<
SOAP-ENV:Header>010105625A
SOAP::Transport::HTTP::Client::send_receive: HTTP::Response=HASH(0x1a6f3ec)
SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 200 OK
Cache-Control: private, max-age=0
Date: Tue, 11 Mar 2008 02:36:02 GMT
Server: Microsoft-IIS/6.0
Content-Length: 537
Content-Type: text/xml; charset=utf-8
Client-Date: Tue, 11 Mar 2008 02:36:02 GMT
Client-Peer: 127.0.0.1:80
Client-Response-Num: 1
MicrosoftOfficeWebServer: 5.0_Pub
X-AspNet-Version: 2.0.50727
X-Powered-By: ASP.NET
true4161
0.0000
SOAP::Deserializer::deserialize: ()
SOAP::Parser::decode: ()
SOAP::SOM::new: ()
true
4
161
0
0.0000
SOAP::Lite::DESTROY: ()
SOAP::Serializer::DESTROY: ()
SOAP::Data::DESTROY: ()
SOAP::Data::DESTROY: ()
SOAP::Data::DESTROY: ()
####
#! /usr/bin/perl
#=======================================================
# Generated by ScriptGen v1.38 (build 126, "OS_BUILD")
# at Thu Mar 06 15:15:30 2008
#=======================================================
use warnings;
use strict;
use CGI qw(:all);
use SOAP::Lite (+trace => 'all', maptype => {} );
use SOAP::Transport::HTTP;
$|++;
my $cgi = new CGI;
#Variables ERR_CODE__ and ERR_DETAILS are reserved for errors indication
my $ERR_CODE__="0";
my $ERR_DETAILS__="";
#=======================================================
# Input Parameters Section. DO NOT EDIT!
#=======================================================
#Name: member_number
#Variable: member_number
#Type: String
#Comment:
my $member_number = $cgi->param("member_number");
if (!(defined $member_number)) {
$ERR_CODE__ = "2";
$ERR_DETAILS__ = "Input parameter 'member_number' is undefined";
}
#Name: postcode
#Variable: postcode
#Type: String
#Comment:
my $postcode = $cgi->param("postcode");
if (!(defined $postcode)) {
$ERR_CODE__ = "2";
$ERR_DETAILS__ = "Input parameter 'postcode' is undefined";
}
#Name: country
#Variable: country
#Type: String
#Comment: Will default to A for the Australian script
my $country = $cgi->param("country");
if (!(defined $country)) {
$ERR_CODE__ = "2";
$ERR_DETAILS__ = "Input parameter 'country' is undefined";
}
#=======================================================
# Output Parameters Section. DO NOT EDIT!
#=======================================================
#Name: comm_remain
#Variable: comm_remain
#Type: String
#Comment:
my $comm_remain="";
#Name: comm_required
#Variable: comm_required
#Type: String
#Comment:
my $comm_required="";
#Name: comm_taken
#Variable: comm_taken
#Type: String
#Comment:
my $comm_taken="";
#Name: outstanding_balance
#Variable: outstanding_balance
#Type: String
#Comment:
my $outstanding_balance="";
#=======================================================
#=== PLEASE INSERT THE CODE HERE FOR ASSIGNING THE REAL VALUES
#=== TO FOLLOWING VARIABLES:
#=== $comm_remain, $comm_required, $comm_taken, $outstanding_balance
#=== SET $ERR_CODE__ = "5" (i.e. "User Defined Error")
#=== AND $ERR_DETAILS__ TO EXPLANATION STRING IF A WRONG CONDITION SHOULD ARISE.
#=== {{{{{
#======CODE ADDED BY SR FOR IVR COMMERCE SERVER INTEGRATION
my $soap = SOAP::Lite
-> uri('http://www.doubleday.com.au/')
-> on_action( sub { join '/', 'http://www.doubleday.com.au', $_[1] } )
-> proxy('http://localhost/IVRWebService/Membership.asmx');
my $header = SOAP::Header->name(MyHeader => {
MyName => "DoubleDayIVRWebServices"
})->uri('http://www.doubleday.com.au/')->prefix('');
my @params = (
$header,
SOAP::Data->name(memberNo => '0101001'),
SOAP::Data->name(postcode => '6033'),
SOAP::Data->name(country => 'A')
);
my $method = SOAP::Data->name('IsMemberValid')
->attr({xmlns => 'http://www.doubleday.com.au/'});
my $result = $soap->call($method=>@params);
if ($result->fault)
{
print $result->faultstring;
}
else
{
print $result->result;
}
$comm_required=$result->valueof('//IsMemberValidResult/comm_required');
$comm_taken=$result->valueof('//IsMemberValidResult/comm_taken');
$comm_remain=$result->valueof('//IsMemberValidResult/comm_remain');
$outstanding_balance=$result->valueof('//IsMemberValidResult/outstanding_balance');
#=== }}}}}
#=======================================================
# Output variables checking.
#=======================================================
if (!(defined $comm_remain && isvalidstring($comm_remain))) {
$ERR_CODE__ = "3";
$ERR_DETAILS__ = "Invalid value '$comm_remain' for parameter 'comm_remain'";
}
if (!(defined $comm_required && isvalidstring($comm_required))) {
$ERR_CODE__ = "3";
$ERR_DETAILS__ = "Invalid value '$comm_required' for parameter 'comm_required'";
}
if (!(defined $comm_taken && isvalidstring($comm_taken))) {
$ERR_CODE__ = "3";
$ERR_DETAILS__ = "Invalid value '$comm_taken' for parameter 'comm_taken'";
}
if (!(defined $outstanding_balance && isvalidstring($outstanding_balance))) {
$ERR_CODE__ = "3";
$ERR_DETAILS__ = "Invalid value '$outstanding_balance' for parameter 'outstanding_balance'";
}
print qq|Content-Type: text/xml\n\n|;
print qq||;
print qq||;
print qq| |;
print qq| |;
print qq| |;
print qq| |;
print qq| |;
print qq| |;
print qq| |;
print qq||;
#=======================================================
# Used functions. DO NOT EDIT!
#=======================================================
sub convert2vxml {
$_ = shift;
s/&/&/g;
s/\\/\\\\/g;
s/</g;
s/>/>/g;
s/"/\\"/g;
s/chr(8)/\\b/g;
s/chr(9)/\\t/g;
s/chr(10)/\\n/g;
s/chr(11)/\\v/g;
s/chr(12)/\\f/g;
s/chr(13)/\\r/g;
s/'/\\'/g;
return $_;
}
sub isvaliddate {
my $input = shift;
my $DataPattern = '^(?:(0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[- /.]((?:19|20)\d\d))$';
if ($input =~ m!$DataPattern!) {
# At this point, $3 holds the year, $1 the month and $2 the day of the date entered
if ($2 == 31 and ($1 == 4 or $1 == 6 or $1 == 9 or $1 == 11)) {
return 0; # 31st of a month with 30 days
} elsif ($2 >= 30 and $1 == 2) {
return 0; # February 30th or 31st
} elsif ($1 == 2 and $2 == 29 and not ($3 % 4 == 0 and ($3 % 100 != 0 or $3 % 400 == 0))) {
return 0; # February 29th outside a leap year
} else {
return 1; # Valid date
}
} else {
return 0; # Not a date
}
}
sub isvalidtime {
my $input = shift;
my $TimePattern = '^(([0-1][0-9]|2[0-3]):[0-5][0-9])$';
if ($input =~ m!$TimePattern!) {
return 1;
}
return 0;
}
sub isvalidnumber {
my $input = shift;
my $NumberPattern = '^([-+]?([0-9]*\.)?[0-9]+)$';
if ($input =~ m!$NumberPattern!) {
return 1;
}
return 0;
}
sub isvalidinteger {
my $input = shift;
my $IntegerPattern = '^([-+]?[0-9]+)$';
if ($input =~ m!$IntegerPattern!) {
return 1;
}
return 0;
}
sub isvalidstring {
my $input = shift;
return 1;
}
sub SOAP::Transport::HTTP::Client::get_basic_credentials {
return 'LAN\username' => 'password';
}
####
-
-
-
DoubleDayIVRWebServices
-
-
010105625
6027
A