[Building Sakai] Sakai Web service Help plz

sandeep nair sandeep.nair85 at gmail.com
Sat Dec 11 22:27:29 PST 2010


Hi,

I am trying to use sakai webservice using axis. I am able to call the
webservice. Like i want to create an account in sakai. So i decided to use
SakaiScript.jws. In that method it needs a session id. So i created a
session using one of the admin login using webservice. Please see the
following snippet

Call nc = (Call) service.createCall();

//Login using admin
            nc.setTargetEndpointAddress("
http://localhost:8080/sakai-axis/SakaiLogin.jws?wsdl");

            nc.removeAllParameters();
            nc.setOperationName("loginToServer");
            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(results);

// Create a test account
            nc.setTargetEndpointAddress("
http://localhost:8080/sakai-axis/SakaiLogin.jws?wsdl");
            nc.removeAllParameters();
            nc.setOperationName("addNewUser");
            nc.addParameter("sessionid",XMLType.XSD_STRING,
ParameterMode.IN);
            nc.addParameter("eid",XMLType.XSD_STRING, ParameterMode.IN);
            nc.addParameter("firstname",XMLType.XSD_STRING,
ParameterMode.IN);
            nc.addParameter("lastname",XMLType.XSD_STRING,
ParameterMode.IN);
            nc.addParameter("email",XMLType.XSD_STRING, ParameterMode.IN);
            nc.addParameter("type",XMLType.XSD_STRING, ParameterMode.IN);
            nc.addParameter("password",XMLType.XSD_STRING,
ParameterMode.IN);
            nc.setReturnType(XMLType.XSD_STRING);
            results = (String) nc.invoke(new Object [] { results,
"test","test","test","test at test.com","","test" });
            System.out.println(results);

----

Now heres the log what i get

Loading
jar:file:/D:/Projects/Doctors.net/work/liferay-portal-6.0-ee/tomcat-6.0.29/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/system.properties
80f3bf13-dfe3-4f58-8f43-e95d6b269b69,http://localhost:8080
Exception :Session "80f3bf13-dfe3-4f58-8f43-e95d6b269b69,
http://localhost:8080" is not active

If you see the first SOP generates a session

And using that session id i try to create an account, which says to me
sesssion is not active.

How can i do this.

Also i read somwhere that using the session id i could just auto login. I
tried doing that but in vain, appending ?session.key=sessionId

Can you please help me?

Sandeep
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20101212/01340c7c/attachment.html 


More information about the sakai-dev mailing list