By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,143 Members | 1,854 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,143 IT Pros & Developers. It's quick & easy.

SOAP::Lite and Apache

P: 2
Hi,

I'm trying to get the Perl SOAP::Lite examples to work on a Windows PC, running Apache 2.2.4.

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:-
Expand|Select|Wrap|Line Numbers
  1. #!C:/Perl/bin/perl -w
  2.  
  3.   use SOAP::Transport::HTTP;
  4.  
  5.   SOAP::Transport::HTTP::CGI   
  6.     -> dispatch_to('Demo')     
  7.     -> handle;
  8.  
  9.   package Demo;
  10.  
  11.   sub hi {                     
  12.     return "hello, world";     
  13.   }
  14.  
  15.   sub bye {                    
  16.     return "goodbye, cruel world";
  17.   }
  18.  
  19.   1;
  20.  
Here's the client:-
Expand|Select|Wrap|Line Numbers
  1. #!C:/Perl/bin/perl -w
  2.  
  3.   use strict;  
  4.   use SOAP::Lite;
  5. #  use SOAP::Lite +debug;
  6.  
  7.   my $soap;
  8.  
  9.   print "Started\n";
  10.  
  11.   $soap = SOAP::Lite                                             
  12.     -> uri('http://www.soaplite.com/Demo')                                             
  13.     -> proxy('http://services.soaplite.com/hibye.cgi')
  14.     -> hi();
  15.  
  16.   if ( $soap -> fault ) {
  17.     print "Failure - ".$soap->faultstring."\n";
  18.   }
  19.   else {
  20.     print "Success - ".$soap->result."\n";
  21.   }
  22.  
  23.   print "\n";
  24.  
  25.   $soap = SOAP::Lite                                             
  26. #    -> uri('http://10.104.196.75/Demo') 
  27.     -> uri('http://10.104.196.75/Demo')                                       
  28.     -> proxy('http://10.104.196.75/cgi-bin/hibye.cgi')
  29. #    -> proxy('http://localhost/cgi-bin/hibye.cgi')
  30.     -> bye();                                                    
  31. #    -> result;
  32.  
  33.   if ( $soap -> fault ) {
  34.     print "Failure - ".$soap->faultstring."\n";
  35.   }
  36.   else {
  37.     print "Success - ".$soap->result."\n";
  38.   }
  39.  
  40.   print "Finished\n";
  41.  
Here's the debug output:-
Expand|Select|Wrap|Line Numbers
  1. H:\scripts>hibye.pl
  2. Unquoted string "debug" may clash with future reserved word at H:\scripts\hibye.
  3. pl line 5.
  4. Started
  5. SOAP::Transport::new: ()
  6. SOAP::Serializer::new: ()
  7. SOAP::Deserializer::new: ()
  8. SOAP::Parser::new: ()
  9. SOAP::Lite::new: ()
  10. SOAP::Transport::HTTP::Client::new: ()
  11. SOAP::Lite::call: ()
  12. SOAP::Serializer::envelope: ()
  13. SOAP::Serializer::envelope: hi
  14. SOAP::Data::new: ()
  15. SOAP::Data::new: ()
  16. SOAP::Data::new: ()
  17. SOAP::Data::new: ()
  18. SOAP::Transport::HTTP::Client::send_receive: HTTP::Request=HASH(0x1b7a244)
  19. SOAP::Transport::HTTP::Client::send_receive: POST http://services.soaplite.com/h
  20. ibye.cgi
  21. Accept: text/xml
  22. Accept: multipart/*
  23. Proxy-Authorization: Basic SU1camdvb2NoOkJlcm5hcmQzMw==
  24. Content-Length: 450
  25. Content-Type: text/xml; charset=utf-8
  26. SOAPAction: "http://www.soaplite.com/Demo#hi"
  27.  
  28. <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:xsi="http://www.w
  29. 3.org/1999/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/e
  30. ncoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="
  31. http://www.w3.org/1999/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xmlsoap
  32. .org/soap/encoding/"><SOAP-ENV:Body><namesp1:hi xmlns:namesp1="http://www.soapli
  33. te.com/Demo"/></SOAP-ENV:Body></SOAP-ENV:Envelope>
  34. SOAP::Transport::HTTP::Client::send_receive: HTTP::Response=HASH(0x1d7bb88)
  35. SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 200 OK
  36. Connection: close
  37. Date: Mon, 13 Aug 2007 14:55:59 GMT
  38. Server: Apache/1.3.37 (Unix) mod_throttle/3.1.2 DAV/1.0.3 mod_fastcgi/2.4.2 mod_
  39. gzip/1.3.26.1a PHP/4.4.7 mod_ssl/2.8.22 OpenSSL/0.9.7e
  40. Content-Length: 535
  41. Content-Type: text/xml; charset=utf-8
  42. Client-Date: Mon, 13 Aug 2007 14:54:17 GMT
  43. Client-Peer: 192.168.12.29:8080
  44. Client-Response-Num: 1
  45. SOAPServer: SOAP::Lite/Perl/0.55
  46.  
  47. <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:xsi="http://www.w
  48. 3.org/1999/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/e
  49. ncoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="
  50. http://www.w3.org/1999/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xmlsoap
  51. .org/soap/encoding/"><SOAP-ENV:Body><namesp1:hiResponse xmlns:namesp1="http://ww
  52. w.soaplite.com/Demo"><s-gensym3 xsi:type="xsd:string">hello, world</s-gensym3></
  53. namesp1:hiResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
  54. SOAP::Deserializer::deserialize: ()
  55. SOAP::Parser::decode: ()
  56. SOAP::SOM::new: ()
  57. SOAP::Lite::DESTROY: ()
  58. SOAP::Deserializer::DESTROY: ()
  59. SOAP::Parser::DESTROY: ()
  60. SOAP::Transport::DESTROY: ()
  61. SOAP::Transport::HTTP::Client::DESTROY: ()
  62. SOAP::Serializer::DESTROY: ()
  63. SOAP::Data::DESTROY: ()
  64. SOAP::Data::DESTROY: ()
  65. SOAP::Data::DESTROY: ()
  66. SOAP::Data::DESTROY: ()
  67. Success - hello, world
  68.  
  69. SOAP::Transport::new: ()
  70. SOAP::Serializer::new: ()
  71. SOAP::Deserializer::new: ()
  72. SOAP::Parser::new: ()
  73. SOAP::Lite::new: ()
  74. SOAP::Transport::HTTP::Client::new: ()
  75. SOAP::Lite::call: ()
  76. SOAP::Serializer::envelope: ()
  77. SOAP::Serializer::envelope: bye
  78. SOAP::Data::new: ()
  79. SOAP::Data::new: ()
  80. SOAP::Data::new: ()
  81. SOAP::Data::new: ()
  82. SOAP::Transport::HTTP::Client::send_receive: HTTP::Request=HASH(0x1e5e0dc)
  83. SOAP::Transport::HTTP::Client::send_receive: POST http://10.104.196.75/cgi-bin/h
  84. ibye.cgi
  85. Accept: text/xml
  86. Accept: multipart/*
  87. Proxy-Authorization: Basic SU1camdvb2NoOkJlcm5hcmQzMw==
  88. Content-Length: 448
  89. Content-Type: text/xml; charset=utf-8
  90. SOAPAction: "http://10.104.196.75/Demo#bye"
  91.  
  92. <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:xsi="http://www.w
  93. 3.org/1999/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/e
  94. ncoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="
  95. http://www.w3.org/1999/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xmlsoap
  96. .org/soap/encoding/"><SOAP-ENV:Body><namesp2:bye xmlns:namesp2="http://10.104.19
  97. 6.75/Demo"/></SOAP-ENV:Body></SOAP-ENV:Envelope>
  98. SOAP::Transport::HTTP::Client::send_receive: HTTP::Response=HASH(0x1e5f028)
  99. SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 503 Service Unavailable
  100. Cache-Control: no-cache
  101. Connection: close
  102. Pragma: no-cache
  103. Content-Length: 751
  104. Content-Type: text/html
  105. Client-Date: Mon, 13 Aug 2007 14:55:07 GMT
  106. Client-Peer: 192.168.12.29:8080
  107. Client-Response-Num: 1
  108. Proxy-Connection: close
  109. Title: Network Error
  110.  
  111. <HTML><HEAD>
  112. <TITLE>Network Error</TITLE>
  113. </HEAD>
  114. <BODY>
  115. <FONT face="Helvetica">
  116. <big><strong></strong></big><BR>
  117. </FONT>
  118. <blockquote>
  119. <TABLE border=0 cellPadding=1 width="80%">
  120. <TR><TD>
  121. <FONT face="Helvetica">
  122. <big>Network Error (tcp_error)</big>
  123. <BR>
  124. <BR>
  125. </FONT>
  126. </TD></TR>
  127. <TR><TD>
  128. <FONT face="Helvetica">
  129. A communication error occurred: "Operation timed out"
  130. </FONT>
  131. </TD></TR>
  132. <TR><TD>
  133. <FONT face="Helvetica">
  134. The Web Server may be down, too busy, or experiencing other problems preventing
  135. it from responding to requests. You may wish to try again at a later time.
  136. </FONT>
  137. </TD></TR>
  138. <TR><TD>
  139. <FONT face="Helvetica" SIZE=2>
  140. <BR>
  141. For assistance, contact your network support team.
  142. </FONT>
  143. </TD></TR>
  144. </TABLE>
  145. </blockquote>
  146. </FONT>
  147. </BODY></HTML>
  148.  
  149. SOAP::Deserializer::deserialize: ()
  150. SOAP::Parser::decode: ()
  151. 503 Service Unavailable at H:\scripts\hibye.pl line 25
  152. SOAP::SOM::DESTROY: ()
  153. SOAP::Lite::DESTROY: ()
  154. SOAP::Deserializer::DESTROY: ()
  155. SOAP::Transport::DESTROY: ()
  156. SOAP::Transport::HTTP::Client::DESTROY: ()
  157. SOAP::Serializer::DESTROY: ()
  158. SOAP::Data::DESTROY: ()
  159. SOAP::Data::DESTROY: ()
  160. SOAP::Data::DESTROY: ()
  161. SOAP::Data::DESTROY: ()
  162. SOAP::Parser::DESTROY: ()
  163.  
Thanks for any help.

J.
Aug 13 '07 #1
Share this Question
Share on Google+
2 Replies


P: 2
...deluged by responses ;-)

FWIW - the problem was that the environment variables HTTP_proxy, etc were all set on my dev machine (in order to allow ppm to function), which was therefore pushing the traffic externally, rather than trying my local Apache server first. Up until this point, I hadn't been aware that HTTP_proxy, etc were for anything other than ppm (not being particularly well-versed in HTTP coding via Perl).

Just adding this for future reference, should anyone stumble on this thread.

J.
Sep 3 '07 #2

miller
Expert 100+
P: 1,089
J.

Thanks for taking the time to follow up with your solution. SOAP::Lite is not a very common need, so I myself have no experience with it yet. But yes, hopefully someone else will be able to benefit from your experience now.

- Miller
Sep 3 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.