in reply to Re: SOAP Server and XML
in thread SOAP Server and XML
use strict; use SOAP::Lite + "trace"; use SOAP::Transport::HTTP; use Data::Dumper; use XML::Simple; my $serverinfo = { version => ["0.1.dev"], validTypes => [ filetype => "txt", filetype => "html", ], statistics => { documentsProcessed => [0], }, }; sub FileQueue::getServerInfo { return SOAP::Data->type( 'xml' => XML::Simple->new(RootName => 'info')->XMLout($ser +verinfo) ) ; } my $daemon = SOAP::Transport::HTTP::Daemon ->new (LocalPort => 88) ->dispatch_to('FileQueue') ; print "Contact to SOAP server at ", $daemon->url, "\n"; $daemon->handle;
use strict; use Data::Dumper; use SOAP::Lite + "trace"; my $soap = SOAP::Lite -> uri('http://www.perlmonks.org/FileQueue') -> proxy('http://localhost:88') ; $soap->readable(1); print $soap->getServerInfo()->result;
<?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/1999/XMLSchema-instanc +e" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:S +OAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http:/ +/www.w3.org/1999/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xm +lsoap.org/soap/encoding/"> <SOAP-ENV:Body> <namesp1:getServerInfoResponse xmlns:namesp1="http://www.perlmonks +.org/FileQueue"> <info> <statistics> <documentsProcessed>0</documentsProcessed> </statistics> <validTypes> <filetype>html</filetype> <filetype>txt</filetype> </validTypes> <version>0.1.dev</version> </info> </namesp1:getServerInfoResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/1999/XMLSchema-instanc +e" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:S +OAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http:/ +/www.w3.org/1999/XMLSchema" xmlns:pmq="http://www.perlmonks.org/FileQ +ueue"> <SOAP-ENV:Body> <pmq:getServerInfoResponse> <info> <version>0.1.dev</version> <statistics> <documentsProcessed>0</documentsProcessed> </statistics> <validTypes> <filetype>txt</filetype> <filetype>html</filetype> </validTypes> </info> </pmq:getServerInfoResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: SOAP Server and XML
by rppowell (Novice) on Nov 28, 2007 at 02:18 UTC | |
by erroneousBollock (Curate) on Nov 28, 2007 at 02:36 UTC |