Spray, boolean interoperability?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Spray, boolean interoperability?

rush
Hi,

This is probably for Steve, but any help would be great.

I am using Spray to test some experimental web services of mine writen in
php with NuSOAP. I am probably doing something very silly, but I can not get
xsd:boolean to transfer properly. I have simple operation that gets boolean
and returns it back. Sending true works fine, but problem is that when I
send false from Dolphin, I get true back :).  If I call the service from
php, I get false back ok.

As far as I can pin point it seems that Spray marshals false as 'false'
(stringlike) or something similar, but nusoap marshals it something like 0
(intlike).

the wsdl for the service can be found at:

http://www.rush.avalon.hr/soapx/s0.php?wsdl

and some formated description is at:

http://www.rush.avalon.hr/soapx/s0.php

(but I am afraid server is at the moment having some trouble)

------------------
here is php code snippet:

$server->register('echoBoolean',
 array('inputDate'=>'xsd:boolean'),
 array('return'=>'xsd:boolean'),
 'http://soapinterop.org/');
function echoBoolean($b){
 //when dolphin sends false here $b evaluates to 'false' as string which is
taken as true value
 // otoh when php sends false $b is 0 which evaluates to false
 if($b){
         return $b;
    }
    return false;
}
-------------
and here is Dolphin
s := SprayWSDLService onUrl:'http://www.rush.avalon.hr/soapx/s0.php?wsdl'

c := s createClient.

r := c send: 'echoBoolean' with: false.

r value  'returns true :)'

Thanx for any help,

rush
--
http://www.templatetamer.com/


Reply | Threaded
Open this post in threaded view
|

Re: Spray, boolean interoperability?

Steve Alan Waring
Hi rush,

> r value  'returns true :)'

I just tried your service, and it returned false for me.

Did you fix this or do you still have the problem?

> As far as I can pin point it seems that Spray marshals false as 'false'
> (stringlike) or something similar, but nusoap marshals it something like 0
> (intlike).

Both are valid, see:
   http://www.w3.org/TR/xmlschema-2/#boolean

Thanks,
Steve
--
Steve Waring
Email: [hidden email]
Journal: http://www.stevewaring.net/blog/home/index.html


Reply | Threaded
Open this post in threaded view
|

Re: Spray, boolean interoperability?

rush
"Steve Waring" <[hidden email]> wrote in message
news:biv8bf$dhege$[hidden email]...
> I just tried your service, and it returned false for me.
>
> Did you fix this or do you still have the problem?

hmm.. yes it is returning true now. I'll try to digg out the version which
was problematic.

Thanks,

rush
--
http://www.templatetamer.com/


Reply | Threaded
Open this post in threaded view
|

Re: Spray, boolean interoperability?

Steve Alan Waring
Hi rush,

> hmm.. yes it is returning true now. I'll try to digg out the version which
> was problematic.

Ok.

FWIW: When I first read your message, my guess was that either the php
server was configured to use one of the earlier schema namespaces, which may
have only supported the boolean literals of "1" or "0". Or, as you had
reused the same part name/input name ("inputDate"), either Spray or the php
server was associating the wrong kind of decoder to the input.

Hope this helps,
Steve

--
Steve Waring
Email: [hidden email]
Journal: http://www.stevewaring.net/blog/home/index.html