[Using Sakai] Sakai WS COnf.
Jigar Joshi
jigarjm at gmail.com
Thu Jul 15 01:55:19 PDT 2010
Thanks Steve,
This is the code to CreateNewSite i have used.
*
*
*
*
*public static String createNewSite(String sessionid, String siteid, String
title, String description, String shortdesc, String iconurl, String infourl,
boolean joinable, String joinerrole, boolean published, boolean publicview,
String skin, String type) {*
* try {*
* Service service = new Service();*
* Call nc = (Call) service.createCall();*
*
nc.setTargetEndpointAddress(SakaiConstants.SAKAI_SCRIPTS_WSDL_LOCATION);*
* nc.removeAllParameters();*
* nc.setOperationName("addNewSite");*
* nc.addParameter("sessionid", XMLType.XSD_STRING,
ParameterMode.IN);*
* nc.addParameter("siteeid", XMLType.XSD_STRING,
ParameterMode.IN);*
* nc.addParameter("title", XMLType.XSD_STRING, ParameterMode.IN);
*
* nc.addParameter("description", XMLType.XSD_STRING,
ParameterMode.IN);*
* nc.addParameter("shortdesc", XMLType.XSD_STRING,
ParameterMode.IN);*
* nc.addParameter("iconurl", XMLType.XSD_STRING,
ParameterMode.IN);*
* nc.addParameter("infourl", XMLType.XSD_STRING,
ParameterMode.IN);*
* nc.addParameter("joinable", XMLType.XSD_BOOLEAN,
ParameterMode.IN);*
* nc.addParameter("joinerrole", XMLType.XSD_STRING,
ParameterMode.IN);*
* nc.addParameter("published", XMLType.XSD_BOOLEAN,
ParameterMode.IN);*
* nc.addParameter("publicview", XMLType.XSD_BOOLEAN,
ParameterMode.IN);*
* nc.addParameter("skin", XMLType.XSD_STRING, ParameterMode.IN);*
* nc.addParameter("type", XMLType.XSD_STRING, ParameterMode.IN);*
* nc.setReturnType(XMLType.XSD_STRING);*
*
*
* String results = (String) nc.invoke(new Object[]{sessionid,
siteid, title, description, shortdesc, iconurl, infourl, new
Boolean(joinable), joinerrole, new Boolean(published), new
Boolean(publicview), skin, type});*
* System.out.println("result : " + results);*
* return results;*
* } catch (Exception e) {*
* e.printStackTrace();*
* return null;*
* }*
* }*
*
I am calling this as follows
System.out.println(""+SakaiScripts.createNewSite(sessionId, "SiteId456",
"TITLE","DESCRIPTION", "SHORT DESC", "
http://www.bsdnexus.com/NetBSD_onastick/images/download-icon-orange.png", "
http://www.mycompany.com", true, "joinroleable", true, true, "", ""));
It creates a site , when i check it from Web Interface it shows the things i
have attached the snapshot
what i want is i want to create a course and i want to create Test & Quizes
for the same ,
students will give test and the score will be given back to them
i want to implement this scenario using WebService.
i want to know its feasibility.
*
On Thu, Jul 15, 2010 at 2:13 PM, Steve Swinsburg
<steve.swinsburg at gmail.com>wrote:
You probably want either copySite or addNewSite. Check the docs on what each
> does.
>
> To add a quiz to a site via web services may be difficult. There was a
> thread about it a few days ago. There are no web services to do this yet.
> And no public API that will allow it out of a site context. However it can
> be done with some work, also in the other thread, so if you want to tackle
> this go for it and send patches!
>
> ~steve
> [sent from my abacus]
>
> On 15/07/2010, at 18:05, Jigar Joshi <jigarjm at gmail.com> wrote:
>
> Hi Steve,
>
> Thank you.
> I am done with login and registration call,
> now what i need to do is i want to create Quiz & Tests using WS,
> for that i need to create work site,
> i couldn't find any method like "createNewWorkSite" in SakaiScript.jws.
>
>
>
> On Thu, Jul 15, 2010 at 7:10 AM, Steve Swinsburg <<steve.swinsburg at gmail.com>
> steve.swinsburg at gmail.com> wrote:
>
>> Hi Jigar,
>>
>> Great. For documentation, the two that you will use the most, if not
>> exclusively, are SakaiLogin and SakaiScript. These have javadocs in the
>> source, or here:
>> <https://source.sakaiproject.org/svn//webservices/tags/sakai-2.6.2/axis/src/webapp/SakaiScript.jws>
>> https://source.sakaiproject.org/svn//webservices/tags/sakai-2.6.2/axis/src/webapp/SakaiScript.jws/ SakaiLogin.jws
>>
>> The other JWS scripts have been deprecated and in 2.8, removed from the
>> deployment altogether.
>>
>> cheers,
>> Steve
>>
>>
>> On 15/07/2010, at 3:03 AM, Jigar Joshi wrote:
>>
>> It worked.
>> One more thing Steve,
>> can you provide me any link to document which describes the
>>
>> Functionality of each WS EndPoint for each JWS available in 2.6.2
>>
>>
>> On Wed, Jul 14, 2010 at 6:54 PM, Steve Swinsburg <<steve.swinsburg at gmail.com>
>> steve.swinsburg at gmail.com> wrote:
>>
>>> Hi Jigar,
>>>
>>> The Axis code looks ok, but the sakai.properties need tweaking:
>>>
>>> try:
>>> webservices.allowlogin=true
>>> webservices.allow = .*
>>>
>>> ie all lowercase and no quotes around the true. This will also open it up
>>> to all IP addresses, so lock it down with the regex expression after you get
>>> it running.
>>>
>>> You can also add:
>>> webservices.log-allowed=true
>>> webservices.log-denied=true
>>>
>>> To add a bit more request logging output to the Tomcat logs so you can
>>> see what it's trying to do.
>>>
>>> cheers,
>>> Steve
>>>
>>>
>>>
>>>
>>> On 14/07/2010, at 9:47 PM, Jigar Joshi wrote:
>>>
>>> I have setup Sakai 2.7 demo
>>> i have added followings to sakai.properties
>>>
>>> webservices.allowLogin="true"
>>> webservices.allow = 127\.0\.0\.1,192\.168\.[3,6]\.\d+,m\.y\.i\.p
>>>
>>> and now if i try to get
>>>
>>> <http://myserver.com/sakai-axis/SakaiPortalLogin.jws>
>>> myserver.com/sakai-axis/SakaiPortalLogin.jws
>>> or
>>> <http://myserver.com/sakai-axis/SakaiPortalLogin.jws?wsdl>
>>> myserver.com/sakai-axis/SakaiPortalLogin.jws?wsdl
>>>
>>> i am getting 404
>>>
>>> code i have written to access login webservice is
>>>
>>> Service service = new Service();
>>>
>>> String id = "admin";
>>> String pw = "admin";
>>>
>>> Call nc = (Call) service.createCall();
>>>
>>> nc.setTargetEndpointAddress("<http://myserver/sakai-axis/SakaiPortalLogin.jws>
>>> http://myserver/sakai-axis/SakaiPortalLogin.jws");
>>>
>>> nc.removeAllParameters();
>>> nc.setOperationName("login");
>>> nc.addParameter("id", XMLType.XSD_STRING, ParameterMode.IN);
>>> nc.addParameter("pw", XMLType.XSD_STRING, ParameterMode.IN);
>>> nc.setReturnType(XMLType.XSD_STRING);
>>>
>>> String results = (String) nc.invoke(new Object[]{id, pw});
>>> System.out.println("sakai_session" + results);
>>>
>>>
>>> output i am getting
>>>
>>> faultCode: { <http://xml.apache.org/axis/%7DHTTP>
>>> http://xml.apache.org/axis/}HTTP
>>> faultSubcode:
>>> faultString: (404)Not Found
>>> faultActor:
>>> faultNode:
>>> faultDetail:
>>> {}:return code: 404
>>> <html><head><title>Apache Tomcat/5.5.28 - Error
>>> report</title><style><!--H1
>>> {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;}
>>> H2
>>> {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;}
>>> H3
>>> {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;}
>>> BODY
>>> {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B
>>> {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;}
>>> P
>>> {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A
>>> {color : black;}A.name {color : black;}HR {color :
>>> #525D76;}--></style> </head><body><h1>HTTP Status
>>> 404 - </h1><HR size="1"
>>> noshade="noshade"><p><b>type</b> Status
>>> report</p><p><b>message</b>
>>> <u></u></p><p><b>description</b>
>>> <u>The requested resource () is not
>>> available.</u></p><HR size="1"
>>> noshade="noshade"><h3>Apache
>>> Tomcat/5.5.28</h3></body></html>
>>> { <http://xml.apache.org/axis/%7DHttpErrorCode:404>
>>> http://xml.apache.org/axis/}HttpErrorCode:404
>>>
>>> (404)Not Found
>>> at
>>> org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java:744)
>>> at
>>> org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:144)
>>> at
>>> org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
>>> at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
>>> at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
>>> at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
>>> at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
>>> at org.apache.axis.client.Call.invoke(Call.java:2767)
>>> at org.apache.axis.client.Call.invoke(Call.java:2443)
>>> at org.apache.axis.client.Call.invoke(Call.java:2366)
>>> at org.apache.axis.client.Call.invoke(Call.java:1812)
>>> at com.mycompany.SakaiWSConsumer.App.main(App.java:31)
>>>
>>>
>>>
>>> Please do the needful
>>>
>>>
>>> --
>>> Regards
>>> Jigar
>>> Programmer Analyst.
>>>
>>>
>>> _______________________________________________
>>> sakai-user mailing list
>>> <sakai-user at collab.sakaiproject.org>sakai-user at collab.sakaiproject.org
>>> <http://collab.sakaiproject.org/mailman/listinfo/sakai-user>
>>> http://collab.sakaiproject.org/mailman/listinfo/sakai-user
>>>
>>> TO UNSUBSCRIBE: send email to
>>> <sakai-user-unsubscribe at collab.sakaiproject.org>
>>> sakai-user-unsubscribe at collab.sakaiproject.org with a subject of
>>> "unsubscribe"
>>>
>>>
>>>
>>
>>
>> --
>> Regards
>> Jigar
>> Programmer Analyst.
>>
>>
>>
>>
>
>
> --
> Regards
> Jigar
> Programmer Analyst.
>
>
>
--
Regards
Jigar
Programmer Analyst.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-user/attachments/20100715/e499b183/attachment-0001.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: download (1).jpg
Type: image/jpeg
Size: 205757 bytes
Desc: not available
Url : http://collab.sakaiproject.org/pipermail/sakai-user/attachments/20100715/e499b183/attachment-0002.jpg
-------------- next part --------------
A non-text attachment was scrubbed...
Name: download.jpg
Type: image/jpeg
Size: 97385 bytes
Desc: not available
Url : http://collab.sakaiproject.org/pipermail/sakai-user/attachments/20100715/e499b183/attachment-0003.jpg
More information about the sakai-user
mailing list