simon.proctor has asked for the wisdom of the Perl Monks concerning the following question:
The server, in this case, simply returns a default response back to the Perl client which is being decoded properly so thats not a problem.javax.xml.soap.SOAPException: Unable to create envelope from given sou +rce: Error on line 1 of document : Undeclared prefix: "SOAP-ENV:enco +dingStyle"
use SOAP::Lite; use Data::Dumper; use strict; use warnings; my $data = <<EOL; <ar> <site url="127.0.0.1" /> <request id="2" type="text" command="AdvertByID" /> </ar> EOL my $service = new SOAP::Lite uri => 'http://test/', proxy => 'http://simonp.intranet-dev:8080/servlet/middleware', soapversion => 1.2, xmlschema => '2001' ; my $fragment = SOAP::Data->type(xml => $data); my $serializer = $service->serializer(); my $env = $serializer->envelope(freeform => $fragment); my $response = $service->call($env); my $body = $response->dataof('//Body/ar/al/ai'); # should give acces +s to body my $attr = $body->attr(); print "Type: ", $attr->{'type'},"\n"; print "ID: ", $attr->{'id'},"\n"; my $summary = $response->dataof('//Body/ar/al/ai/summary'); $attr = $summary->attr(); print "Summary: ", $attr->{'data'},"\n"; my $title = $response->dataof('//Body/ar/al/ai/title'); $attr = $title->attr(); print "Title: ", $attr->{'data'},"\n"; my $anchor = $response->dataof('//Body/ar/al/ai/anchor'); $attr = $anchor->attr(); print "Link: ", $attr->{'data'},"\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Interfacing SOAP::Lite with JAXM based SOAP Server - XML Error
by redsquirrel (Hermit) on Jun 25, 2002 at 13:48 UTC | |
by simon.proctor (Vicar) on Jun 25, 2002 at 13:58 UTC |