[Building Sakai] checkForSite issue

Jon Wheat jwheat at messiah.edu
Thu Aug 13 08:18:22 PDT 2009


I just figured this out.
I'm on Windows using ActivePerl and SOAP::LITE connecting to Sakai v2.5
 
I had to add ->result to the end of my soap call to get the actual result from the function (makes sense, right?)
The 1 I was getting was PERL telling me the soap call was 'successful' - even though it wasn't the successful I wanted.
For this now, boolean true = 1 and false = 0 (again, makes sense)
 
Here's a snip of my code block now - incase anyone else is having this problem -
 
  $siteExists = $soap2->checkForSite($session, $newsiteid)->result;
 
 if ($siteExists == 1) {
  print "skipping $newsiteid - Already Exists\n";
 } else {
   print "\nCreating site \"$title\" \n ";  
....
 
I think I'm good to go now - whew.
 
 -Jon


>>> Steve Swinsburg <steve.swinsburg at gmail.com> 8/13/2009 6:18 AM >>>
Jon,

What's the value you are passing in as your siteid?

And what version Sakai/webservices are you running? For me on trunk, passing in 'blah' as the siteid (where blah is an invalid siteid) returns false. By the way, this particular webservice actually returns a boolean, so in some clients that might be interpreted as a string - it's non empty therefore might be success.

For Perl, use a boolean type from SOAP::Lite:

my $true = SOAP::Data->value('true')->type('boolean');
my $false = SOAP::Data->value('')->type('boolean');
cheers,
Steve

On 12 Aug 2009, at 20:27, Jon Wheat wrote:



I think I'm missing something simple.
I have this in a perl script -
 
$siteExists = $soap2->checkForSite($session, $newsiteid);
 
however $siteExists is always 1 no matter whether the site is in Sakai or not.
 
Any idea how to get the true/false checkForSite actually returns ?
 
I didn't see this is a bug in Jira at all, so it must be me.
 
 -Jon
 
 
 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
..:: Just because you've always done it that way, doesn't mean it's not incredibly stupid
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Jonathan Wheat /  Developer
Luminis Developers Network
Messiah College, ITS
717.766.2511 x3385
Personal Blog : http://blogs.messiah.edu/wheat_world
LDN - Luminis Developer Network - http://www.lumdev.net
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
_______________________________________________
sakai-dev mailing list
sakai-dev at collab.sakaiproject.org
http://collab.sakaiproject.org/mailman/listinfo/sakai-dev

TO UNSUBSCRIBE: send email to sakai-dev-unsubscribe at collab.sakaiproject.org with a subject of "unsubscribe"

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20090813/ce5a5157/attachment.html 


More information about the sakai-dev mailing list