Pleas help: URGENT
I worked with Steve's perl scripts for years now.
I changed these lines:
#loginUrl = serverUrl + '/sakai-axis/SakaiLogin.jws?wsdl'
#scriptUrl = serverUrl + '/sakai-axis/SakaiScript.jws?wsdl';
with the following:
loginUrl = serverUrl + "/sakai-ws/soap/login?wsdl"
scriptUrl = serverUrl + "/sakai-ws/soap/sakai?wsdl"
BUT still, I have this error: Use of uninitialized value $sessionId in concatenation (.) or string at addUser_21.pl line 65.
here's the perl script in question:
#!/usr/bin/perl -w
#
# Perl script to add a list of users to sakai and enroll
# them in a given course. Users are read from a csv formatted
# file with lines like the following:
#
# netId;firstName;lastName;userEmail;role;password
#
use SOAP::Lite;
# Sakai service location constants
use constant {
LOGIN_WS => "/sakai-ws/soap/login?wsdl",
SCRIPT_WS => "/sakai-ws/soap/sakai?wsdl",
IIHEM_ADDR => "\@iihem.ac.ma",
# IIHEM_ADDR => "",
};
# Initialize variables from command line parameters
my $userlist = shift;
my $host = shift;
my $id = shift;
my $password = shift;
# Routine to display some usage information
sub usage {
print "\nUsage: useradd.pl filename host username password [siteId]
[roleId]\n\n";
print "e.g. useradd.pl userlist.csv http://localhost:8080 admin
admin_pass\n\n";
}
# Routine to connect to sakai login service
sub sakaiLogin {
return $host.LOGIN_WS;
}
# Routine to connect to
sub sakaiScript {
return $host.SCRIPT_WS;
}
# Routine to create an email address
sub makeEmail {
my $username = shift;
return $username.IIHEM_ADDR;
}
# If either are undefined, display usage and exit
if (!$userlist ||
!$host ||
!$id ||
!$password) {
&usage;
exit;
}
# Open the file containing the user list
open(USERLIST, $userlist) || die "Unable to open $userlist!\n";
# Initialize SOAP
client
$loginClient = SOAP::Lite->new(proxy => &sakaiLogin($host));
$sessionId = $loginClient->login($id, $password)->result;
print "SESSION_ID: ".$sessionId."\n";
$scriptClient = SOAP::Lite->new(proxy => &sakaiScript($host));
while () {
chop;
($netId, $firstName, $lastName, $userEmail, $role, $password) = split(/;/);
my $email = &makeEmail($userEmail);
print
"Attempting to add user:\n";
print "\tEID:\t\t".$netId."\n";
print "\tFIRST_NAME:\t".$firstName."\n";
print "\tLAST_NAME:\t".$lastName."\n";
print "\tEMAIL:\t".$email."\n";
print "\tRole:\t".$role."\n";
print
"\tPASSWORD:\t".$password."\n";
my $result =
$scriptClient->addNewUser($sessionId,
$netId,
$firstName,
$lastName,
$email,
$role,
$password)->result;
print "Result: ".$result."\n";
print "\n";
}
$loginClient->logout($sessionId);
close(USERLIST);
Thank you so much for your help.
Attached is the the perl script embedded above.
--

Alaa NIZAR, BA in MIS, LPIC
IIHEM Network Services Manager
+212 661 99 26 01
www.iihem.ac.ma
use SOAP::Lite;
print SOAP::Lite
-> service('http://www.xmethods.net/sd/StockQuoteService.wsdl')
-> getQuote('MSFT');--
You received this message because you are subscribed to the Google Groups "Sakai Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sakai-dev+...@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/sakai-dev/aceccde765e05f34f78932dedbd00c70.squirrel%40webmail.iihem.ac.ma.
Hi,
I confirm that Python script is working just fine. Had to change debug=1 to debug=0.
Now trying to modify it for the other functions like: change pass, copySite, addUserToSite, remUser, remUserFromSite, ...etc
Still waiting for Steve possible hack to make those perl scripts working again.
Thank you Guys,
I'm not sure what's wrong with the Perl SOAP and don't know much about SOAP
Lite. But I *know* that this Python script on
https://confluence.sakaiproject.org/display/WEBSVCS/How+to+use+the+Sakai+Web+Services
still works fine.
Maybe you're missing creating a service and using this pattern
with the Sakai
WSLwould get it to work?
use SOAP::Lite;
print SOAP::Lite
-> service('http://www.xmethods.net/sd/StockQuoteService.wsdl')
-> getQuote('MSFT');
> Alaa NIZAR, BA in MIS, LPIC
> IIHEM Network Services Manager
> +212 661 99 26 01
> www.iihem.ac.ma
>
> --
> You received this message because you are subscribed to the Google Groups
> "Sakai
Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sakai-dev+...@apereo.org.
> To view this discussion on the web visit
>
https://groups.google.com/a/apereo.org/d/msgid/sakai-dev/aceccde765e05f34f78932dedbd00c70.squirrel%40webmail.iihem.ac.ma
>
> .
>
--
You received this message because you are subscribed to the Google Groups "Sakai
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
sakai-dev+...@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/sakai-dev/CACqbowt%2B3XQO1-NaonmaYWamB2sm_JHeFtRxmJMSbaHB9z0bBw%40mail.gmail.com.
--
This message has been scanned for viruses and dangerous content
, and believed to be clean.
Hi Matthew,
Here's what I get when adding StockQuoteService:
Service description 'http://www.xmethods.net/sd/StockQuoteService.wsdl' can't be loaded: 500 Can't connect to www.xmethods.net:80 (Name or service not known)
using both http and https.
Yours,
I'm not sure what's wrong with the Perl SOAP and don't know much about SOAP
Lite. But I *know* that this Python script on
https://confluence.sakaiproject.org/display/WEBSVCS/How+to+use+the+Sakai+Web+Services
still works fine.
Maybe you're missing creating a service and using this pattern
with the Sakai
WSLwould get it to work?
use SOAP::Lite;
print SOAP::Lite
-> service('http://www.xmethods.net/sd/StockQuoteService.wsdl')
-> getQuote('MSFT');
> Alaa NIZAR, BA in MIS, LPIC
> IIHEM Network Services Manager
> +212 661 99 26 01
> www.iihem.ac.ma
>
> --
> You received this message because you are subscribed to the Google Groups
> "Sakai
Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sakai-dev+...@apereo.org.
> To view this discussion on the web visit
>
https://groups.google.com/a/apereo.org/d/msgid/sakai-dev/aceccde765e05f34f78932dedbd00c70.squirrel%40webmail.iihem.ac.ma
>
> .
>
--
This message has been scanned for viruses and dangerous content
, and believed to be clean.
BIG SUCCESS!
I managed to move all Sakai functions that were in perl scripts to Python3 script.
It works just fine.
Please where can I find all Sakai webservices calls?
Thank you
I'm not sure what's wrong with the Perl SOAP and don't know much about SOAP
Lite. But I *know* that this Python script on
https://confluence.sakaiproject.org/display/WEBSVCS/How+to+use+the+Sakai+Web+Services
still works fine.
Maybe you're missing creating a service and using this pattern
with the Sakai
WSLwould get it to work?
use SOAP::Lite;
print SOAP::Lite
-> service('http://www.xmethods.net/sd/StockQuoteService.wsdl')
-> getQuote('MSFT');
> Alaa NIZAR, BA in MIS, LPIC
> IIHEM Network Services Manager
> +212 661 99 26 01
> www.iihem.ac.ma
>
> --
> You received this message because you are subscribed to the Google Groups
> "Sakai
Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sakai-dev+...@apereo.org.
> To view this discussion on the web visit
>
https://groups.google.com/a/apereo.org/d/msgid/sakai-dev/aceccde765e05f34f78932dedbd00c70.squirrel%40webmail.iihem.ac.ma
>
> .
>
--
You received this message because you are subscribed to the Google Groups "Sakai
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
sakai-dev+...@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/sakai-dev/CACqbowt%2B3XQO1-NaonmaYWamB2sm_JHeFtRxmJMSbaHB9z0bBw%40mail.gmail.com.
--
This message has been scanned for viruses and dangerous content
, and believed to be clean.
Hi all,
I found this web service to activate/deactivate a user from a given site. However, what is the function to activate/deactivate a user from the whole system!!
From the web interface, I can make a user enabled or disabled. what is the corresponding web service function?
Thank you
/**
* Activate/Deactivate an user in a site
*
* @param sessionid a valid session
id
* @param siteid
the id of the site
* @param eid the
id of the user to activate/deactivate
* @param active
true for activate, false to deactivate
* @return true if all went ok or exception otherwise
* @return Success or exception message
*/
Hi,
I'm using the proposed Python3 scripts. They are working fine EXCEPT for two webservices: copySite and addNewSite. Below are the code for copySite.py and copySite.csv and the error I'm getting from sakai 21:
copySite.py:
"""
Python3
"""
import os
import sys
import csv
from zeep import Client
##################### EDIT HERE #####################
username
= 'admin_u'
password = 'admin_p'
#serverUrl =
"https://trunk-mysql.nightly.sakaiproject.org"
#serverUrl = "https://qa11-oracle.nightly.sakaiproject.org"
serverUrl = "http://localhost:8080"
filename = "copySite.csv"
debug = 0
############## DO NOT EDIT BELOW HERE
##############
############## OR DO IF YOU WANT TO :p ##############
#loginUrl = serverUrl +
'/sakai-axis/SakaiLogin.jws?wsdl'
#scriptUrl = serverUrl + '/sakai-axis/SakaiScript.jws?wsdl';
loginUrl = serverUrl + "/sakai-ws/soap/login?wsdl"
scriptUrl = serverUrl + "/sakai-ws/soap/sakai?wsdl"
loginProxy =
Client(loginUrl)
scriptProxy = Client(scriptUrl)
if debug:
print("loginUrl: {0}".format(loginUrl))
sessionId = loginProxy.service.login(username, password)
with open(filename, 'r') as csvFile:
dialect = csv.Sniffer().sniff(csvFile.read(1024))
csvFile.seek(0)
reader = csv.reader(csvFile, dialect)
for row in
reader:
siteidtocopy = row[0]
newsiteid = row[1]
title = row[2]
description = row[3]
shortdesc = row[4]
iconurl = row[5]
infourl = row[6]
joinable = row[7]
joinerrole = row[8]
published = row[9]
publicview = row[10]
skin = row[11]
type =
row[12]
if (debug):
print("OrigSite: {0} Site:
{1} Title: {2} description: {3} shortdesc: {4} iconurl: {5} infourl: {6} joinable: {7} joinerrole:
{8} published: {9} publicview: {10} skin: {11} type: {12}".format(siteidtocopy,
newsiteid, title, description, shortdesc, iconurl, infourl, joinable, joinerrole, published,
publicview, skin, type))
else:
result =
scriptProxy.service.copySite(sessionId, siteidtocopy, newsiteid, title, description, shortdesc,
iconurl, infourl, joinable, joinerrole, published, publicview, skin, type)
print("Creating site {0}
was a {1}".format(newsiteid, result))
loginProxy.service.logout(sessionId)
copySite.csv:
gsa_demo,STA200A,STA200A,Elementary Statistics,Elementary
Statistics,/library/icon/default.gif,,false,access,true,false,,project
gsa_demo,STA200B,STA200B,Elementary Statistics,Elementary
Statistics,/library/icon/default.gif,,false,access,true,false,,project
and here's the Error:
Creating site STA200A was a org.sakaiproject.exception.IdUnusedException
: null
Creating site STA200B was a java.lang.NullPointerException : null
Creating site STA200C was a java.lang.NullPointerException : null
Thank you for your help
--
You received this message because you are subscribed to the Google Groups "Sakai Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sakai-dev+...@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/sakai-dev/e2b36b682cef788e9fc3a0f95af4ae64.squirrel%40webmail.iihem.ac.ma.