use strict; use SOAP::Transport::HTTP; use XML::Writer; use IO::String; SOAP::Transport::HTTP::CGI -> dispatch_to('Foo') -> handle ; package Foo; sub foo { my ($self,$value) = @_; my $output = IO::String->new; my $writer = XML::Writer->new( OUTPUT => $output, DATA_MODE => 1, DATA_INDENT => 3, ); $writer->startTag('foo'); $writer->emptyTag('bar',type => $value); $writer->endTag('foo'); $writer->end; return ${$output->string_ref}; } #### use strict; use SOAP::Lite; print SOAP::Lite -> uri('http://localhost/Foo') -> proxy('http://localhost/cgi-bin/xml_soap.cgi') -> foo('baz') -> result ;