SOAP::Lite and boolean result types 
Author Message
 SOAP::Lite and boolean result types

I'm trying to write a Perl SOAP client that accesses a demo web
service method
that returns its result as a boolean.  The Perl client via SOAP::Lite
doesn't seem to understand this; it returns a "Wrong boolean value
'false'"
error.

Is this a known problem with SOAP::Lite?  With interop?  Or am I doing
something wrong or leaving an explicit data conversion out?  I've
looked
through the SOAP::Lite doc but haven't seen anything concerning types
of
method results, just types of method parameters.

I have been able to access this demo web service using a Java client
correctly, and I have been able to write Perl clients that access
other
web services correctly, so I think my overall setup is ok.

Details follow.

Thanks for any light shed on this ...

Jonathan Schilling      Caldera International, Inc.     jls at caldera
dot com

The client, in Perl, using a freshly installed SOAP::Lite via CPAN,
running on a Linux system with Perl 5.6.0:

#! /usr/bin/perl

use lib '/home/jls/.cpan/build/SOAP-Lite-0.51/lib';
use SOAP::Lite;

my $year = shift;
print "Testing for whether ", $year, " is a leap year\n";
my $soap = SOAP::Lite
   -> uri('urn:jls-LeapYear')
   -> proxy(' http://www.*-*-*.com/ :8080/soap/servlet/rpcrouter');
my $result = $soap->isLeapYear( $year );
print $result, "\n";

The service (in Java, deployed via Apache SOAP and tomcat, on a Unix
system):

import java.util.GregorianCalendar;

public class LeapYear {
        public static boolean isLeapYear(int year) {
                GregorianCalendar c = new GregorianCalendar();
                return c.isLeapYear(year);
        }

Quote:
}

The service deployment descriptor:

<dd:service xmlns:dd=" http://www.*-*-*.com/ ;
    id="urn:jls-LeapYear">
 <dd:provider type="java"
             scope="Application"
             methods="isLeapYear">
 <dd:java class="LeapYear"
         static="true" />
 </dd:provider>  
 <dd:faultListener>
  org.apache.soap.server.DOMFaultListener
 </dd:faultListener>
 <dd:mappings />
</dd:service>

The result:


Testing for whether 2002 is a leap year
Wrong boolean value 'false'
<?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV=" http://www.*-*-*.com/ ;
xmlns:xsi=" http://www.*-*-*.com/ ;
xmlns:xsd=" http://www.*-*-*.com/ ;>
<SOAP-ENV:Body>
<ns1:isLeapYearResponse xmlns:ns1="urn:jls-LeapYear"
SOAP-ENV:encodingStyle=" http://www.*-*-*.com/ ;>
<return xsi:type="xsd:boolean">false</return>
</ns1:isLeapYearResponse>

</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
 at leap-year-client.pl line 11



Mon, 09 Aug 2004 06:52:30 GMT  
 SOAP::Lite and boolean result types

Quote:
> I'm trying to write a Perl SOAP client that accesses a demo web
> service method
> that returns its result as a boolean.  The Perl client via SOAP::Lite
> doesn't seem to understand this; it returns a "Wrong boolean value
> 'false'"
> error.

> Is this a known problem with SOAP::Lite?  

Thanks to Mr Kulchenko, the answer turns out to be: this didn't work right
in SOAP::Lite 0.51 due to specification ambiguity, and was fixed in 0.52.

I upgraded to 0.52 and it works correctly now.

Jonathan Schilling



Tue, 10 Aug 2004 04:30:17 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. SOAP::Lite and boolean result types

2. Using complex types with SOAP::Lite

3. SOAP in Apache with SOAP::Lite

4. SOAP in Apache with SOAP::Lite

5. How to suppress methodName element in soap:Body of envelope with SOAP::Lite

6. Accessing Unix SOAP::Lite Services from MS SOAP Toolkit

7. over-riding values using SOAP::Lite WSDL support

8. SOAP::Lite

9. SOAP:Lite question

10. SOAP::Lite, Data::Dumper and getting the values

11. SOAP::Lite -- calling Perl services from other languages.

12. Using SOAP::Lite module on remote server, Google API

 

 
Powered by phpBB® Forum Software