tk is not the problem. i took your example code and recreated your problem in my win2000 environment. as for creating a good example of the problem, well done! that made this problem easy for me to track down. i wish all my developers could boil their problems down to a examples this small.

back to the problem at hand. two small changes will fix this right up--one on the server, and one on the client.

here is my modified client. notice i modified the uri to point to a valid urn. this is very important--the urn is relative to the host, so absolute path really screws it up. in fact, i'm surprised it resolved it at all! there should probably be better error checking for valid urns in SOAP::Lite, to prevent others from making this mistake as well.

#!/usr/bin/perl -w use strict; use SOAP::Lite; use Tk; my( $server, $port, $urn )= qw(localhost 3004 urn://My/Soapy); my $main= MainWindow->new; my $button= $main->Button( -text => 'go!', -command => \&get, )->pack; MainLoop; sub get { print "got: ", ## SOAP::Lite->uri('http://tako:3004/My/Soapy') SOAP::Lite->uri($urn) ->proxy("http://${server}:$port") ->testy() ->result, $/; }

okay, i lied. actually the only change you need was to the client. but as i mentioned before, i prefer dispatch_with over dispatch_to, so i've modified your server to use that style. i prefer dispatch_with both because you can set your server up with multiple urns, handled by multiple packages; and because the urn and handler are paired in a hash, they are self-documenting.

#!/usr/bin/perl -w use strict; use SOAP::Transport::HTTP; my( $server, $port, $urn, $handler )= qw(localhost 3004 urn://My/Soapy My::Soapy); SOAP::Transport::HTTP::Daemon ->new( LocalAddr => $server, LocalPort => 3004, )->dispatch_to('My::Soapy')->handle; ## )->dispatch_with({ $urn => $handler }) ->handle or die 'a horrible death!'; package My::Soapy; sub testy() { 'happy!' }

by the way, you should always test for errors on your server, even in an example script. and if you are using a perl >= 5.006, you should consider use warnings over -w.

~Particle *accelerates*


In reply to Re^3: SOAP::Lite in Windows by particle
in thread SOAP::Lite in Windows by anjiro

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.