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* |