I'm trying to get the Perl SOAP::Lite examples to work on a Windows PC, running Apache 2.2.4. Although I've several years' of Perl experience, my knowledge of webservers and their configuration etc is a little limited.
Apache is definitely serving CGI scripts, as I've tested a dummy Hello World thing. I'm also definitely getting a hit when I use a browser to get to my hibye.cgi server (well, a blank page rather than a 404).
However, when I run my hibye.pl client, I receive a 503 Service Unavailable at H:\scripts\hibye.pl line 25.
It works when I access the SOAP server at http://services.soaplite.com, but not the one on my webserver.
Is there some specific Apache config required? Am I missing something fundamental?
NB if I use localhost rather than the IP address I get 301 Moved Permanently.
Here's the server:-
#!C:/Perl/bin/perl -w use SOAP::Transport::HTTP; SOAP::Transport::HTTP::CGI -> dispatch_to('Demo') -> handle; package Demo; sub hi { return "hello, world"; } sub bye { return "goodbye, cruel world"; } 1;
#!C:/Perl/bin/perl -w use strict; use SOAP::Lite; # use SOAP::Lite +debug; my $soap; print "Started\n"; $soap = SOAP::Lite -> uri('http://www.soaplite.com/Demo') + -> proxy('http://services.soaplite.com/hibye.cgi') -> hi(); if ( $soap -> fault ) { print "Failure - ".$soap->faultstring."\n"; } else { print "Success - ".$soap->result."\n"; } print "\n"; $soap = SOAP::Lite # -> uri('http://10.104.196.75/Demo') -> uri('http://10.104.196.75/Demo') + -> proxy('http://10.104.196.75/cgi-bin/hibye.cgi') # -> proxy('http://localhost/cgi-bin/hibye.cgi') -> bye(); # -> result; if ( $soap -> fault ) { print "Failure - ".$soap->faultstring."\n"; } else { print "Success - ".$soap->result."\n"; } print "Finished\n";
Here's the debug output:-
H:\scripts>hibye.pl Unquoted string "debug" may clash with future reserved word at H:\scri +pts\hibye. pl line 5. Started SOAP::Transport::new: () SOAP::Serializer::new: () SOAP::Deserializer::new: () SOAP::Parser::new: () SOAP::Lite::new: () SOAP::Transport::HTTP::Client::new: () SOAP::Lite::call: () SOAP::Serializer::envelope: () SOAP::Serializer::envelope: hi SOAP::Data::new: () SOAP::Data::new: () SOAP::Data::new: () SOAP::Data::new: () SOAP::Transport::HTTP::Client::send_receive: HTTP::Request=HASH(0x1b7a +244) SOAP::Transport::HTTP::Client::send_receive: POST http://services.soap +lite.com/h ibye.cgi Accept: text/xml Accept: multipart/* Proxy-Authorization: Basic SU1camdvb2NoOkJlcm5hcmQzMw== Content-Length: 450 Content-Type: text/xml; charset=utf-8 SOAPAction: "http://www.soaplite.com/Demo#hi" <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:xsi="ht +tp://www.w 3.org/1999/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap. +org/soap/e ncoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" x +mlns:xsd=" http://www.w3.org/1999/XMLSchema" SOAP-ENV:encodingStyle="http://schem +as.xmlsoap .org/soap/encoding/"><SOAP-ENV:Body><namesp1:hi xmlns:namesp1="http:// +www.soapli te.com/Demo"/></SOAP-ENV:Body></SOAP-ENV:Envelope> SOAP::Transport::HTTP::Client::send_receive: HTTP::Response=HASH(0x1d7 +bb88) SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 200 OK Connection: close Date: Mon, 13 Aug 2007 14:55:59 GMT Server: Apache/1.3.37 (Unix) mod_throttle/3.1.2 DAV/1.0.3 mod_fastcgi/ +2.4.2 mod_ gzip/1.3.26.1a PHP/4.4.7 mod_ssl/2.8.22 OpenSSL/0.9.7e Content-Length: 535 Content-Type: text/xml; charset=utf-8 Client-Date: Mon, 13 Aug 2007 14:54:17 GMT Client-Peer: 192.168.12.29:8080 Client-Response-Num: 1 SOAPServer: SOAP::Lite/Perl/0.55 <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:xsi="ht +tp://www.w 3.org/1999/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap. +org/soap/e ncoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" x +mlns:xsd=" http://www.w3.org/1999/XMLSchema" SOAP-ENV:encodingStyle="http://schem +as.xmlsoap .org/soap/encoding/"><SOAP-ENV:Body><namesp1:hiResponse xmlns:namesp1= +"http://ww w.soaplite.com/Demo"><s-gensym3 xsi:type="xsd:string">hello, world</s- +gensym3></ namesp1:hiResponse></SOAP-ENV:Body></SOAP-ENV:Envelope> SOAP::Deserializer::deserialize: () SOAP::Parser::decode: () SOAP::SOM::new: () SOAP::Lite::DESTROY: () SOAP::Deserializer::DESTROY: () SOAP::Parser::DESTROY: () SOAP::Transport::DESTROY: () SOAP::Transport::HTTP::Client::DESTROY: () SOAP::Serializer::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () Success - hello, world SOAP::Transport::new: () SOAP::Serializer::new: () SOAP::Deserializer::new: () SOAP::Parser::new: () SOAP::Lite::new: () SOAP::Transport::HTTP::Client::new: () SOAP::Lite::call: () SOAP::Serializer::envelope: () SOAP::Serializer::envelope: bye SOAP::Data::new: () SOAP::Data::new: () SOAP::Data::new: () SOAP::Data::new: () SOAP::Transport::HTTP::Client::send_receive: HTTP::Request=HASH(0x1e5e +0dc) SOAP::Transport::HTTP::Client::send_receive: POST http://10.104.196.75 +/cgi-bin/h ibye.cgi Accept: text/xml Accept: multipart/* Proxy-Authorization: Basic SU1camdvb2NoOkJlcm5hcmQzMw== Content-Length: 448 Content-Type: text/xml; charset=utf-8 SOAPAction: "http://10.104.196.75/Demo#bye" <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:xsi="ht +tp://www.w 3.org/1999/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap. +org/soap/e ncoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" x +mlns:xsd=" http://www.w3.org/1999/XMLSchema" SOAP-ENV:encodingStyle="http://schem +as.xmlsoap .org/soap/encoding/"><SOAP-ENV:Body><namesp2:bye xmlns:namesp2="http:/ +/10.104.19 6.75/Demo"/></SOAP-ENV:Body></SOAP-ENV:Envelope> SOAP::Transport::HTTP::Client::send_receive: HTTP::Response=HASH(0x1e5 +f028) SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 503 Service Unav +ailable Cache-Control: no-cache Connection: close Pragma: no-cache Content-Length: 751 Content-Type: text/html Client-Date: Mon, 13 Aug 2007 14:55:07 GMT Client-Peer: 192.168.12.29:8080 Client-Response-Num: 1 Proxy-Connection: close Title: Network Error <HTML><HEAD> <TITLE>Network Error</TITLE> </HEAD> <BODY> <FONT face="Helvetica"> <big><strong></strong></big><BR> </FONT> <blockquote> <TABLE border=0 cellPadding=1 width="80%"> <TR><TD> <FONT face="Helvetica"> <big>Network Error (tcp_error)</big> <BR> <BR> </FONT> </TD></TR> <TR><TD> <FONT face="Helvetica"> A communication error occurred: "Operation timed out" </FONT> </TD></TR> <TR><TD> <FONT face="Helvetica"> The Web Server may be down, too busy, or experiencing other problems p +reventing it from responding to requests. You may wish to try again at a later t +ime. </FONT> </TD></TR> <TR><TD> <FONT face="Helvetica" SIZE=2> <BR> For assistance, contact your network support team. </FONT> </TD></TR> </TABLE> </blockquote> </FONT> </BODY></HTML> SOAP::Deserializer::deserialize: () SOAP::Parser::decode: () 503 Service Unavailable at H:\scripts\hibye.pl line 25 SOAP::SOM::DESTROY: () SOAP::Lite::DESTROY: () SOAP::Deserializer::DESTROY: () SOAP::Transport::DESTROY: () SOAP::Transport::HTTP::Client::DESTROY: () SOAP::Serializer::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () SOAP::Parser::DESTROY: ()
Thanks for any help.
J.
In reply to SOAP::Lite and Apache by furrypop
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |