Commit 0b6820be authored by rygelgit's avatar rygelgit

Adding Response validation

parent d9483200
......@@ -31,12 +31,25 @@ package ResponseValidator;
sub valiate_soap_response {
my $soap_response = $_[0];
#if($soap_response->code == 200) {
print $soap_response->as_string;
#}
#else {
# print $soap_response->as_string;
#}
if($soap_response->is_success) {
print "************Success*************\n";
print_message ($soap_response);
} else {
print "************Error*************\n";
print_message ($soap_response);
}
print "\n************End of Action*************\n";
}
sub print_message {
print "Response status : \n";
print "-----------------\n";
print $_[0]->status_line . "\n";
print "\n";
print "Response Body: \n";
print "--------------\n";
print $_[0]->content . "\n";
}
1;
......@@ -39,7 +39,7 @@ sub invoke_soap_request {
#print "Request Message : " . $_[2] . "\n";
#print "Soap Action :".$_[3] . "\n";
my $post_url = $SoapHeaders::http_prefix . $_[0] . $SoapHeaders::separator . $_[1] . $SoapHeaders::control_url;
print $post_url;
#print $post_url;
my $user_agent = LWP::UserAgent->new();
my $soap_request = HTTP::Request->new(POST => $post_url);
$soap_request->header(SOAPAction => $_[3]);
......
......@@ -61,6 +61,7 @@ sub get_user_input {
print "Enter the DIAGE host Port Number : ";
our $PORT = <>;
chomp $PORT;
print "\n";
return ($USR_OPT, $IP, $PORT);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment