Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...The level of expertise is awesome. The nature in which people respond is professional helpful and not the least condescending. I can't say that for most forums..."

Geography

Where in the world do Tek-Tips members come from?
pvarke2 (Programmer)
21 Mar 05 13:23
Hi,

I am trying to interface to the Oracle Calendar Web Services Server using SOAP through Perl. My problem is not, however, specific to Oracle. It involves errors encountered in posting a raw SOAP request. The Perl code is in A. The SOAP msg payload is in B. The error response is in C.

A.
#!/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', 'http://development-10.cc.uic.edu/ocws-bin/ocas.fcgi',
HTTP::Headers->new('Content-Type' => 'text/xml', 'SOAPAction' => 'http://www.oracle.com/WebServices/Calen\
daring/1.0/'), $data_to_send));
#
#-- Print the response
print $response->as_string;

Note that I have my SOAP payload in the soap_req.soap file. This is a simple Ping command. Here is the listing:

B.
<?xml version='1.0' encoding='UTF-8'?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<cwsl:Ping xmlns:cwsl=
"http://www.oracle.com/WebServices/Calendaring/1.0/">
</cwsl:Ping>
</soap:Body>
</soap:Envelope>


But, this doesn't seem to work. (I realise that I have not set the Content-Length SOAP header in the Perl code. If this could be the source of the problem, would someone please tell me whether the Content-Length includes the length of the headers also or just the payload).

The listing for the response in SOAP indicates a "method name not supported error". Here is the listing for the response:

C.
HTTP/1.1 500 Internal Server Error
Connection: close
Date: Mon, 21 Feb 2005 18:22:24 GMT
Server: Apache/1.3.31 (Unix) mod_fastcgi/2.2.12 mod_perl/1.27 mod_ssl/2.8.19 OpenSSL/0.9.7d
Content-Type: text/xml; charset=utf-8
Client-Date: Mon, 21 Feb 2005 18:37:54 GMT
Client-Peer: 128.248.155.93:80
Client-Response-Num: 1
Client-Transfer-Encoding: chunked

<?xml version="1.0" encoding="utf-8" ?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<soap:Body>
<soap:Fault>
<faultcode>soap:Client.Error::System::SOAPRequest</faultcode>
<faultstring>The SOAPAction's method name is not supported</faultstring>
<detail>
<cwsl:Error xmlns:cwsl="http://www.oracle.com/WebServices/Calendaring/1.0/">
<Class>Error::System::SOAPRequest</Class>
<Code>0020-00-00-00000009</Code>
<Line>1258</Line>
<FileName>SOAPRequestHandler.cpp,v</FileName>
<Version>1.33</Version>
<LastMod>2003/09/16 19:40:42</LastMod>
<Author>ericp</Author>
<Date>Mon Feb 21 12:22:24 2005</Date>
<PID>21360</PID>
<TID>3030703024</TID>
<Level>Error</Level>
</cwsl:Error>
</detail>
</soap:Fault>
</soap:Body>
</soap:Envelope>


Would greatly appreciate any help with this.

Thanks,
Paul
pvarke2 (Programmer)
8 Apr 05 12:24
Hi,

I have managed to successfully resolve this issue. This post is for the benefit of others who might encounter a similar problem.

As I had suspected, the code and the SOAP message body was correct. The problem lay within the SOAP headers - specifically, the SOAPAction header.

The SOAPAction header requires double-quotes at the beginning and ending as part of its value, unlike
other headers. This implies that from the code, the SOAPHeader value should be specified as a string withing a string, as in:

SOAPAction = '"http://...../ocas.fcgi"'; (from Perl)
or
SOAPAction = "/"http://...../ocas.fcgi/""; (from C/C++)

I hit on this when I carefully observed the headers dumped from Ethereal in a successful SOAP session through the Java client.


Paul

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Back To Forum

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close