Problem with SOAP::Lite

Problem with SOAP::Lite

am 09.10.2007 19:03:58 von info

When I call a webservice on a .net machine with the script below, I
only receive a 1 or a true as a result. Instead of that I should
receive an XML file. Anybody...... what am I doing wrong??
In a SSH session everything looks perfect. I even see the XML string
with the response, but not in my browser.

$xml = qq(


NL
NL
Amstelborgh
2
200
25-10-2007
27-10-2007
E
EUR
false

);

$xml =~ s/\<\?xml.*\?\>\n?//;
$xml =~ s/\<\!.*\>\n?//;

use SOAP::Lite +trace =>debug;
$client = SOAP::Lite
-> uri('.... bla bla bla')
-> proxy(' bla bla bla')
-> on_action(sub{sprintf '%s%s', @_ })
;

$res=SOAP::Data->type('xml' => $xml);
$result = $client->GetProductsForTourOperator($res);

print "content-type:text/html\n\n";
print qq~
testing.... (result: $result)
~;

Re: Problem with SOAP::Lite

am 09.10.2007 19:32:49 von glex_no-spam

info@xperience-webdevelopment.nl wrote:
> When I call a webservice on a .net machine with the script below, I
> only receive a 1 or a true as a result. Instead of that I should
> receive an XML file. Anybody...... what am I doing wrong??

No idea what you 'should' receive.. but..

[...]
> $res=SOAP::Data->type('xml' => $xml);
> $result = $client->GetProductsForTourOperator($res);

Possibly:
my $result = $client->GetProductsForTourOperator($res)->result;

>
> print "content-type:text/html\n\n";

Also, that should be

Content-Type: text/html


Run the script from the command line, and print $result.
If that works, then try it as a CGI.

Re: Problem with SOAP::Lite

am 09.10.2007 22:36:06 von xhoster

info@xperience-webdevelopment.nl wrote:
> When I call a webservice on a .net machine with the script below, I
> only receive a 1 or a true as a result.

> $result = $client->GetProductsForTourOperator($res);

I think that what you are getting here is a result object, and that object
has overloaded stringification (or boolean which is being bootstrapped into
stringification, or something) so that instead of printing as an object
usually does (something like "CGI=HASH(0x609210)"), it instead prints as
"1", presumably to indicate that the result object is not in an error
state.

Xho

--
-------------------- http://NewsReader.Com/ --------------------
The costs of publication of this article were defrayed in part by the
payment of page charges. This article must therefore be hereby marked
advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
this fact.