Skip to content

Instantly share code, notes, and snippets.

@klette
Created November 29, 2009 19:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save klette/245019 to your computer and use it in GitHub Desktop.
Save klette/245019 to your computer and use it in GitHub Desktop.
#!/usr/bin/perl
use strict;
use LWP::UserAgent;
use HTTP::Request;
my $ua = LWP::UserAgent->new(env_proxy => 1, keep_alive => 1, timeout => 30, );
my $data_to_send;#-- And build a string of it
open(SOAPREQ,"soap_req.soap");
while(<SOAPREQ>) {
$data_to_send = "$data_to_send$_";
}
print "Sending :\n$data_to_send\n";
#-- Create the Request Object and send the data
my $response =
$ua->request(HTTP::Request->new('POST', 'https://www.kalender.ntnu.no/ocws-bin/ocas.fcgi',
HTTP::Headers->new('Content-Type' => 'text/xml', 'SOAPAction' => '"http://www.oracle.com/WebServices/Calendaring/1.0/Search"'), $data_to_send));
#
#-- Print the response
print $response->as_string;
<?xml version='1.0' encoding='UTF-8'?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<auth:BasicAuth xmlns:auth="http://soap-authentication.org/2002/01/">
<Name>kriskl</Name>
<Password>****</Password>
</auth:BasicAuth>
</soap:Header>
<soap:Body>
<cwsl:Search xmlns:cwsl="http://www.oracle.com/WebServices/Calendaring/1.0/">
<CmdId>foo</CmdId>
<vQuery>
<From>VEVENT</From>
</vQuery>
</cwsl:Search>
</soap:Body>
</soap:Envelope>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment