sub uploadCodeCoverageZip {
# Verify everything and if it checks out call the WSDL. Otherwise just
+ return error
my $self = shift();
my $ret = "Unknown Error\n";
# get an xml from xml::simple
my $ws_request = createCodeCoverageObject(
password => $self->{password},
coverageType => $self->{coverageType},
buildVersion => $self->{buildVersion},
testPlanId => $self->{testPlanId},
loginId => $self->{loginId},
cloverFilePath => $self->{cloverFilePat
+h},
);
my $multipart = MIME::Entity->build(Type => "multipart/mix
+ed"); # this might work but gives a Not a scalar reference when used
+ as request content
my $url = 'http://someserver.com/path/to/ws'; '#'my server
my $ua = LWP::UserAgent->new;
my $h = HTTP::Headers->new;
my $file = '/etc/passwd'; # Name the file
open(INFO, $file); # Open the file
my @lines = <INFO>; # Read it into an array
close(INFO);
$h->header('Content-Type' => 'multipart/mixed', Accept=>'appli
+cation/json','Cookie', $by->{cookie},'User-Agent', $self->getUserAgen
+t());
my @ws_result_array = ();
# approximating the post request
push (@ws_result_array, '--Boundary');
push (@ws_result_array, $ws_request);
push (@ws_result_array, '--Boundary');
push (@ws_result_array, @lines);
my $GetReq = HTTP::Request->new(
'POST',
$url,
$h,
@ws_result_array // not sure what to put here
);
print $GetReq->as_string;
my $resp = $ua->request($GetReq);
print $resp->decoded_content;
return "eod";
}
the above code returns a request syntactically incorrect response from server
I have tried attaching objects to the multipart object but that gives a not a scalar reference error.
do let me know if you need nething
thnx
|