NAME
submitJob.pl - CGI script to receive jobs for Helios via HTTP POST
DESCRIPTION
#[] more doc!
SUPPORTED FORMATS
#[] more documentation here later
FORM ENCODED
#[] more doc!
XML POSTDATA
Example of submitting a Helios job by POSTing an XML stream:
#!/usr/bin/env perl
use strict;
use warnings;
use LWP::UserAgent;
use HTTP::Request::Common;
my $userAgent = LWP::UserAgent->new();
my $jobXML = <<ENDXML;
<?xml version="1.0" encoding="UTF-8"?>
<job type="Helios::TestService">
<params>
<arg1>a posted test job!</arg1>
<note>this time without the class map</note>
</params>
</job>
ENDXML
my $response = $userAgent->request(POST 'http://localhost/cgi-bin/submitJob.pl',
Content_Type => 'text/xml',
Content => $message
);
print $response->as_string;
RESPONSE
HTTP/1.1 200 OK
Connection: close
Date: Fri, 16 Dec 2011 04:24:30 GMT
Server: Apache/2.2.14 (Ubuntu)
Vary: Accept-Encoding
Content-Type: text/xml; charset=ISO-8859-1
Client-Date: Fri, 16 Dec 2011 04:24:30 GMT
Client-Peer: 127.0.0.1:80
Client-Response-Num: 1
Client-Transfer-Encoding: chunked
<?xml version="1.0" encoding="UTF-8"?>
<response>
<status>0</status>
<jobid>42</jobid>
</response>
FUNCTIONS
lookupJobClass($type)
Given a job type, lookupJobClass() queries the HELIOS_CLASS_MAP table to determine if a Helios service class is associated with that job type. If there is, the function returns that service class. If it isn't, the original type is assumed to be the name of the desired service class, and it is returned to the caller instead.
parseArgXMLForType
SEE ALSO
helios_job_submit.pl, helios.pl, Helios::Service, Helios::Job
AUTHOR
Andrew Johnson, <lajandy at cpan dot org>
COPYRIGHT AND LICENSE
Copyright (C) 2011 Andrew Johnson.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.0 or, at your option, any later version of Perl 5 you may have available.
WARRANTY
This software comes with no warranty of any kind.