need to call server from the client using soap

i hv a hello1.pm in lib folder saved under cgi-bin code as

#!c:\perl\bin\perl.exe # hello1.pm - simple Hello module use strict; sub sayHello { shift; return "Hello " . shift; } 1;

I hv a hello.cgi saved under cgi-bin code as follows

#!c:\perl\bin\perl.exe use lib 'hello1.pm'; # hello.cgi - Hello SOAP handler print "Content-Type: text/html\n\n"; #my $length = $ENV{'CONTENT_LENGTH'}; #print $length; #print "hello world"; use SOAP::Transport::HTTP; SOAP::Transport::HTTP::CGI -> dispatch_to('hello1::(?:sayHello)') -> handle ;

i hv a helloclient.pl saved under cgi-bin code as follows

#!c:\perl\bin\perl.exe # hw_client.pl - Hello client use SOAP::Lite; #use cgi; use hello1; #my $cgi_in; #my $cgi = new CGI ; #$cgi_in = sayHello($cgi); #print "Content-Type: text/html\n\n"; #print "Content- Length: 66"; my $name = shift; #print "$name"; print "\n\nCalling the SOAP Server to say hello\n\n"; print "The SOAP Server says: "; print SOAP::Lite -> uri('urn:hello') -> proxy('http://localhost/cgi-bin/hello.cgi') -> sayHello($name) -> result ; print "welcome";

when i run the client program as

perl helloclient.pl latha

output must be like

nCalling the SOAP Server to say hello The SOAP Server says: Hello latha welcome

but helloclient program fails to call the hello.cgi

when i compile hello.cgi it is showing an error that status:411 Lenth Required

pls help to solve this

Thanks in advance

latha

Edited by planetscape - added rudimentary formatting, moved text out of code tags

( keep:0 edit:20 reap:1 )


In reply to not able to call server fromm client using soap by svanapall

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.