Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

SOAP::Lite Hello World Help

by abhishes (Friar)
on Sep 09, 2002 at 17:13 UTC ( [id://196360]=perlquestion: print w/replies, xml ) Need Help??

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

Hello All,
I have installed soap lite on my windows machine and I am not able to execute the Hello World sample from james snell's soap programming book.

Please tell me what I am doing wrong.
Hello.pm -------- package Hello; sub sayHello{ shift; return "Hello ". shift(@_); } HelloSoap.plx ------------- use strict; use warnings; use SOAP::Transport::HTTP; use Hello 'c:/Inetpub/Scripts'; SOAP::Transport::HTTP::CGI ->dispatch_to('Hello::(?:sayHello)') ->handle ; HelloClient.pl -------------- use strict; use warnings; use SOAP::Lite; my $name = shift; print "The soap server says "; print SOAP::Lite ->uri('urn:Example1') ->proxy('http://localhost/Scripts/HelloSoap.plx') ->sayHello('$name') ->result. "\n\n";

When I run my client (perl HelloClient.pl World) it doesn't do hello world. it just says "soap server says: " and then the program completes. no error messages ... no warnings... Please tell me what is incorrect in my code.

regards,
Abhishek.

edited: Tue Sep 10 02:43:41 2002 by jeffa - code tags and +2 mop of <br/> removal

Replies are listed 'Best First'.
Re: SOAP::Lite Hello World Help
by semio (Friar) on Sep 10, 2002 at 05:33 UTC
    abhishes, try placing use SOAP::Lite +trace => debug; in your client script.

    Using the example posted, I see >Failed to access class (Example1) : Can't locate Example1.pm in @INC (@INC contains:) in the debug output.

    From here, just a few changes.

    my $name = shift; print "The soap server says "; print SOAP::Lite ->uri('urn:Hello') # replace with Hello class ->proxy('http://localhost/cgi-bin/HelloSoap.plx') ->sayHello($name) # removes tics ->result. "\n\n";
    C:\web>helloclient.pl "Perl Monks!"
    The soap server says Hello Perl Monks!

    hope this helps.
    cheers, -semio

      Bingo !!!. You did it.

      Yes. It works for me now. The namespace was wrong.
      When I changed it to urn:Hello it works for me as well.
      Thank you so much.

      regards,
      Abhishek.
Re: SOAP::Lite Hello World Help
by weini (Friar) on Sep 09, 2002 at 18:28 UTC
    Are you sure you have an "1" in the last line of your .pm-file? A Module always must return true ...

    Good luck!
    weini

Re: SOAP::Lite Hello World Help
by rbc (Curate) on Sep 09, 2002 at 17:20 UTC
    When you run HelloClient.pl to you give it an argument?
    As in ...
    $ HelloClient.pl World
      yes. I run my client like
      perl HelloClient.pl World

      The first param is assigned to a variable called name by
      the line

      my $name = shift;

      regards,
      Abhishek

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2024-03-29 06:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found