Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

apache web service with perl client

by vhn2000 (Initiate)
on Aug 15, 2012 at 22:27 UTC ( #987643=perlquestion: print w/replies, xml ) Need Help??

vhn2000 has asked for the wisdom of the Perl Monks concerning the following question:

hi all, I've ran into something rather strange. I installed apache on my windows box, set it up to run some sample Soap::Lite code.I'm lost at this behavior.

so i'd have: => client code
demo.cgi => server code

if i run the from command line(perl, i'd get the html content of the default page in the directory(index.html). Now if i run from the browser(http://server/, i get the expected result("hello word"). Both attempts are ran on the same machine. here's my result:
c:\Program Files (x86)\Apache Software Foundation\Apache2.2\cgi-bin>pe +rl SOAP::Transport::HTTP::Client::send_receive: POST http://localhost/dem +o.cgi HTTP /1.1 Accept: text/xml Accept: multipart/* Accept: application/soap Content-Length: 401 Content-Type: text/xml; charset=utf-8 SOAPAction: "Demo#hi" <?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:xsi="http:/ +/www.w3.or g/2001/XMLSchema-instance" xmlns:soapenc=" +oap/encodi ng/" xmlns:xsd="" soap:encodingStyle=" +http://sch" xmlns:soap="http://schemas.xmlsoap.or +g/soap/env elope/"><soap:Body><hi xmlns="Demo" xsi:nil="true" /></soap:Body></soa +p:Envelope > SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 200 OK Connection: close Date: Wed, 15 Aug 2012 22:07:56 GMT Accept-Ranges: bytes ETag: "100000000f854-2c-3e95575ae9680" Server: Apache/2.2.22 (Win32) Content-Length: 44 Content-Type: text/html Last-Modified: Sat, 20 Nov 2004 19:16:26 GMT Client-Date: Wed, 15 Aug 2012 22:07:56 GMT Client-Peer: Client-Response-Num: 1 <html><body><h1>It works!</h1></body></html>

Replies are listed 'Best First'.
Re: apache web service with perl client
by linuxer (Curate) on Aug 15, 2012 at 22:33 UTC

    Welcome here.

    I can't find or understand your question. Is there a question? What do you want to know?

      what I'm wondering is why when i run the client code via command line - it doesn't work. but when i run the client code via browser by typing the http://localhost/, i was able to get the expected value.

        So you have a script, which we do not know and which you do not show. And this script seems to produce different output depending on how it was called.

        Well, without seeing the relevant code, it's hard to guess (at least for me). Sorry.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://987643]
Approved by Corion
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2021-05-15 18:53 GMT
Find Nodes?
    Voting Booth?
    Perl 7 will be out ...

    Results (150 votes). Check out past polls.