Created
November 29, 2009 19:02
-
-
Save klette/245019 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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