Problem with SOAP::Lite

I

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(
<?xml version="1.0" encoding="utf-8"?>
<theCallInfo>
<strCountry>NL</strCountry>
<strLanguage>NL</strLanguage>
<strTourOperator>Amstelborgh</strTourOperator>
<strNrOfassured>2</strNrOfassured>
<strTotalAmount>200</strTotalAmount>
<startDate>25-10-2007</startDate>
<endDate>27-10-2007</endDate>
<Coverage>E</Coverage>
<strCurrency>EUR</strCurrency>
<bSingleTrip>false</bSingleTrip>
</theCallInfo>
);

$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)
~;
 
J

J. Gleixner

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.
 
X

xhoster

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,968
Messages
2,570,153
Members
46,699
Latest member
AnneRosen

Latest Threads

Top