Hi, Prasenjeet!
> Replacing the int with a boolean (the intention being true for
> long,
> false for short) on the other hand, consistently causes Soap::Lite
> to
> throw a fault: "Application failed during request deserialization:
> Wrong boolean value 'true'".
That's a known problem with SOAP::Lite v0.51. boolean type in XML
Schema 1999 doesn't accept 'true/false', only '1/0' which is
incorrect. You either need to use XML Schema 2001 (instead of 1999)
which does correct processing or do something like this (right after
'use SOAP::Lite;' or 'use SOAP::Transport::HTTP;'):
*SOAP::XMLSchema1999::Deserializer::as_boolean =
*SOAP::XMLSchemaSOAP1_1::Deserializer::as_boolean =
\&SOAP::XMLSchema2001::Deserializer::as_boolean;
It's already fixed in the current version which will be available
--cough, cough -- really soon. Let me know if you still have any
problem.
Best wishes, Paul.
--- Prasenjeet Dutta <prasenjeetd@...> wrote:
> Hi,
>
> I have a really basic question -- please forgive me if it's been
> already been answered. I wrote a simple web service to display a
> fortune, using Soap::Lite 0.51. The client was written in Java,
> using
> Apache Soap 1.2.
>
> The service has has one method, getFortune, that takes an int (zero
>
> for a short fortune, non-zero for a longer fortune) and returns a
> string -- the fortune itself. This works fine.
>
> Replacing the int with a boolean (the intention being true for
> long,
> false for short) on the other hand, consistently causes Soap::Lite
> to
> throw a fault: "Application failed during request deserialization:
> Wrong boolean value 'true'".
>
> I am constructing my parameter in Java this way:
> parameters.addElement(
> new Parameter(
> "bShortFortune",
> boolean.class,
> new Boolean(false),
> null
> )
> );
>
> And in perl, ...
> sub getFortune {
> my ($class, $bShort) = @_;
> my $fortune;
> if (not $bShort) {
> $fortune .= "bShort is false";
> } else {
> $fortune .= "bShort is TRUE";
> }
> }
>
> The request and response are below. As you can see, the client
> encodes the boolean as
> <bShortFortune xsi:type="xsd:boolean">true</bShortFortune>.
> Is this a problem?
>
> Regards,
> --Prasenjeet
>
>
> = REQUEST ===============================
>
> POST /cgi-bin/soapfortune2.pl HTTP/1.0
> Host: styx:80
> Content-Type: text/xml; charset=utf-8
> Content-Length: 466
> SOAPAction: ""
>
> <?xml version='1.0' encoding='UTF-8'?>
> <SOAP-ENV:Envelope
> xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
> xmlns:xsd="http://www.w3.org/1999/XMLSchema">
> <SOAP-ENV:Body>
> <ns1:getFortune xmlns:ns1="SoapDev/Fortune"
>
> SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
> <bShortFortune xsi:type="xsd:boolean">true</bShortFortune>
> </ns1:getFortune>
> </SOAP-ENV:Body>
> </SOAP-ENV:Envelope>
>
> = RESPONSE ===============================
>
> HTTP/1.1 500 Internal Server Error
> Date: Wed, 10 Oct 2001 14:15:07 GMT
> Server: Apache/1.3.19 (Unix) (Red-Hat/Linux) mod_ssl/2.8.1
> OpenSSL/0.9.6 DAV/1.0.2 PHP/4.0.4pl1
> SOAPServer: SOAP::Lite/Perl/0.51
> Content-Length: 612
> Connection: close
> Content-Type: text/xml; charset=utf-8
>
> <?xml version="1.0" encoding="UTF-8"?>
> <SOAP-ENV:Envelope
> xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
>
> SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
> xmlns:xsd="http://www.w3.org/1999/XMLSchema">
> <SOAP-ENV:Body>
> <SOAP-ENV:Fault>
> <faultcode xsi:type="xsd:string">
> SOAP-ENV:Client
> </faultcode>
> <faultstring xsi:type="xsd:string">
> Application failed during request deserialization:
> Wrong
> boolean value 'true'
> </faultstring>
> </SOAP-ENV:Fault>
> </SOAP-ENV:Body>
> </SOAP-ENV:Envelope>
>
>
>
>
>
> ------------------------ Yahoo! Groups Sponsor
>
> To unsubscribe from this group, send an email to:
> soaplite-unsubscribe@yahoogroups.com
>
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>
__________________________________________________
Do You Yahoo!?
NEW from Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
http://geocities.yahoo.com/ps/info1