Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

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:
test.pl => client code
demo.cgi => server code

if i run the test.pl from command line(perl test.pl), i'd get the html content of the default page in the directory(index.html). Now if i run test.pl from the browser(http://server/test.pl), 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 test.pl 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="http://schemas.xmlsoap.org/s +oap/encodi ng/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" soap:encodingStyle=" +http://sch emas.xmlsoap.org/soap/encoding/" 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: 16.85.88.10:8080 Client-Response-Num: 1 <html><body><h1>It works!</h1></body></html>

Comment on apache web service with perl client
Download Code
Re: apache web service with perl client
by linuxer (Deacon) 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/client.pl, 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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2014-09-16 23:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (53 votes), past polls