[Building Sakai] Assignment web service

Stephen Marquard stephen.marquard at uct.ac.za
Tue Aug 4 11:30:33 PDT 2009


Also if you don't match up the parameter types that you're passing with the method signature, you don't get back any useful output (it just fails silently). Some of the parameters in the .jws are numeric types which you may need to cast explicitly in the perl code to a SOAP data type (or change the jws method to accept strings for everything).

Cheers
Stephen
 
>>> Zhen Qian <zqian at umich.edu> 8/4/2009 8:23 PM >>> 
Sean:

I tried the WSAssignment.jws service and here is what I found:

1) there is a typo inside your perl file below:

> my $result = $scriptsoap->createAssignment($session, $title,  
> $dueTime, $openTime, $closeTime, $maxPoints, $gradeType,  
> $instructions, $subType);
should be:

my $result = $scriptsoap->createAssignment($session, $context,  
$title, $dueTime, $openTime, $closeTime, $maxPoints, $gradeType,  
$instructions, $subType);

2) The integrateGradebook() function seems to be outdated and need  
some modification. How about if you comment out the following line  
inside your jws and see if the addAssignment works(it worked for me!)

integrateGradebook(aReference, null, "add", title, maxGradePoints,  
dt, null, null, context);

Thanks,

- Zhen





On Aug 3, 2009, at 6:57 PM, Sean Keesler wrote:

> Stephen,
>
> I haven't had much success here.
> I've dropped that file into my webservices/axis/src/webapp/  
> directory, compiled and deployed webservices.
> I can verify that something comes up when I go to http://myserver/ 
> sakai-axis/WSAssignment.jws?wsdl
>
> However, when I run a script that calls the createAssignment method  
> (below), nothing seems to happen. No new records in  
> assignment_assignment, no messages in the logs. Has anyone else  
> tried this out?
>
> #!/usr/bin/perl -w
> #use diagnostics;
> use SOAP::Lite;
>
> my $user = 'admin';
> my $password = 'adminpassword';
>
> my $loginURI = "http://myserver/sakai-axis/SakaiLogin.jws?wsdl";
> my $scriptURI = "http://myserver/sakai-axis/WSAssignment.jws?wsdl";
>
> my $loginsoap = SOAP::Lite
> -> proxy($loginURI)
> -> uri($loginURI);
>
> my $scriptsoap = SOAP::Lite
> -> proxy($scriptURI)
> -> uri($scriptURI);
>
>
> #START
> print "\n";
>
> #get session
> my $session = $loginsoap->login($user, $password)->result;
> print "session is: " . $session . "\n";
>
> #read file
> #parameters: sessionId context title dueTime openTime closeTime  
> maxPoints gradeType instructions subType
> open FILE, "/vol3/rsmart_clev2.5.5/webservices/data/ 
> assignments.csv" or die $!;
> while (<FILE>) {
>     @parts = split(/,/, $_);
>
>     my $context = $parts[0];
>     my $title = $parts[1];
>     my $dueTime = $parts[2];
>     my $openTime= $parts[3];
>     my $closeTime = $parts[4];
>     my $maxPoints = $parts[5];
>     my $gradeType = $parts[6];
>     my $instructions = $parts[7];
>     my $subType = $parts[8];
>
>     print "creating Assignment: " . $title . "\n";
>     print "  context = " . $context . "\n";
>     print "  dueTime = " . $dueTime . "\n";
>     print "  openTime = " . $openTime . "\n";
>     print "  closeTime = " . $closeTime . "\n";
>     print "  maxPoints = " . $maxPoints . "\n";
>     print "  gradeType = " . $gradeType . "\n";
>     print "  instructions = " . $instructions . "\n";
>     print "  subType = " . $subType . "\n";
>
>         my $result = $scriptsoap->createAssignment($session,  
> $title, $dueTime, $openTime, $closeTime, $maxPoints, $gradeType,  
> $instructions, $subType);
>
>     print $result . "\n";
> }
>
> # logout
> my $logout = $loginsoap->logout($session)->result;
> print "logging out: " . $logout . "\n";
>
>
> #END
> print "\n";
> exit;
>
>
> Sean Keesler
> 130 Academy Street
> Manlius, New York 13104 USA
> 315-663-7756
> sean.keesler at threecanoes.com
>
>
> On Fri, Jul 31, 2009 at 10:25 AM, Stephen Marquard  
> <stephen.marquard at uct.ac.za> wrote:
> http://source.cet.uct.ac.za/svn/sakai/src_mods/trunk/webservices/ 
> axis/src/webapp/WSAssignment.jws
>
> includes a createAssignment() method. I'm not sure whether we're  
> actually using it (that method, we are using other methods in the  
> jws), so you may need to test it.
>
> Cheers
> Stephen
>
>
>
>
> Stephen Marquard, Learning Technologies Co-ordinator
> Centre for Educational Technology, University of Cape Town
> http://www.cet.uct.ac.za
> Email/IM/XMPP: stephen.marquard at uct.ac.za
> Phone: +27-21-650-5037 Cell: +27-83-500-5290
> >>> Sean Keesler <sean at keesler.org> 2009/07/31 03:59 PM >>>
> Has anyone written a web service that will add assignments to sites?
>
>
> Sean Keesler
> 130 Academy Street
> Manlius, New York 13104 USA
> 315-663-7756
> sean.keesler at threecanoes.com
> _______________________________________________
> 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"
>
>
> _______________________________________________
> 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"




More information about the sakai-dev mailing list