After having invoked SOAP::Transport::HTTP::CGI->handle(), all is over. Your CGI initialization doesn't do anything.

Then, you don't pass a CGI object to your emailfind::findingit method, which is OK, since you won't get a CGI object initialized anyways. Despite the CGI in the name, the SOAP::Transport::HTTP::CGI package doesn't use CGI and munges headers and POST params otherwise ('tis all LWP::* stuff).

I haven't found a way yet to set a cookie via a SOAP client request, but the following rewrite might take you a bit further.

Server code:

#!/usr/bin/perl use SOAP::Transport::HTTP; SOAP::Transport::HTTP::CGI->dispatch_to("emailfind")->handle; package emailfind; use HTTP::Cookies; sub findingit { warn "****** findingit(".join(',',map{"'$_'"}@_).")\n"; my $function = shift; my $cookiejar = shift; die "No cookies" unless $cookiejar; my $cookie = $cookiejar->as_string(); die "no cookie" if (!$cookie || $cookie =~ /WALOGIN="RESET/); #ex +it function if cookie empty or is RESET my ($e) = $cookie =~ /WALOGIN="([^"]+)"/; return $e; }

Client code:

#!/usr/bin/perl use warnings; use SOAP::Lite; use HTTP::Cookies; my $cookie = HTTP::Cookies->new(); $cookie->set_cookie(undef,'WALOGIN','foo@bar.com','/','localhost',80,1 +,1,100,0); my $soap = SOAP::Lite -> uri('http://localhost/emailfind') -> proxy( 'http://localhost/cgi-bin/soapdish2.pl', ); my $res = $soap->findingit($cookie); print $res->result,"\n";

Note that you don't call fault on your $soap object, but on the result object of the SOAP call - otherwise "fault" would be dispatched as a XML RPC call to the soap server.

--shmem

_($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                              /\_¯/(q    /
----------------------------  \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}

In reply to Re: Creating SOAP client to pass data to Java by shmem
in thread Creating SOAP client to pass data to Java by Anonymous Monk

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.