[Building Sakai] Create new Sakai service

Absar Ahamed absar.ahamed at gmail.com
Mon Jul 26 04:12:48 PDT 2010


Hello David

Thanks for your reply

One thing i didn;t understand which component do you  say in
/[mycomponent]/WEB-INF/lib/
Other thing is that iam able to run other scipts which is working perfectly
as expected

Example

#!/usr/bin/perl
use SOAP::Lite;
my $host='http://localhost:8080';
my $soap = SOAP::Lite
-> proxy("$host/sakai-axis/SakaiLogin.jws?wsdl");
my $result =$soap->login("admin","admin");
my $sessionid=$result->result();
$soap = SOAP::Lite
-> proxy("$host/sakai-axis/SakaiScript.jws?wsdl");
$soap->addNewUser($sessionid, 'tnus', 'tnus', 'tm', 'tnus at xx.nl', '',
'useruser');
$soap->addMemberToSiteWithRole($sessionid,
'b9b86b3c-2b3f-43da-9796-37456e8f5a65','tanus','access');
if ($result->fault) {
print "Error";
} else {
print "Successn";
}

this script is working fine for adding the new user and adding the new user
to a particular site. I dont know why its not working in WSProfile.jws file.
can you please explain me in details for adding users details in
WSProflie.jws

thanks in advance

On Mon, Jul 26, 2010 at 4:18 PM, David Horwitz <david.horwitz at uct.ac.za>wrote:

> Something to check as well is that your API's are not getting bundled in
> the sakai component. If you look in tomcat/components/[my
> component]/WEB-INF/lib/
>
> You should only see your impl jars and third party jars. This is
> something that can lead to classcast exception
>
> On 07/26/2010 12:23 PM, Steve Swinsburg wrote:
> > Hi,
> >
> > You are on the right path. You need to inject your service into your tool
> so that it can access it since they are in different classloaders. You do
> this via Spring. You first setup the service as a bean, then add the Spring
> listener in your web.xml and an applicationContext.xml to setup your tool as
> a beans and inject the service beans into it.
> >
> > Using the app buikder check out the components.xml in the pack module and
> the web.xml and applicationContext in tool. If you generate a Wicket tool
> with the app builder you'll get it all.
> >
> > cheers,
> > Steve
> >
> >
> >
> >
> > On 26/07/2010, at 8:03 PM, Le Nguyen Thach wrote:
> >
> >
> >> Hi
> >>
> >> I need to write a new Sakai service to do some basic business logic in
> my project. It supposes to work like some other Sakai services
> (UserDirectoryService, SiteService ..etc). I could not find any tutorial on
> the internet so I created my service as a Sakai Application ( but with no
> tool implementation) using Sakai App Builder. Luckily , It worked. I can
> successfully call a test method like this from my Sakai application.
> >> -----
> >> public String testme(){
> >>    return "OK";
> >> }
> >> -----
> >> But I hit a wall when I started putting real task in it.
> >>
> >> ----Method getMyClass() declared in myservice-api
> >>
> >> public MyClass getMyClass();
> >> ----
> >>
> >> I want to pass the return value to the tool layer in my application . So
> I implemented a method like this in myapp-api and my myapp-impl.
> >>
> >> ----api
> >> public MyClass getServiceClass(int parameter);
> >> -----impl
> >> public MyClass getServiceClass(int parameter){
> >>     return myservice.getMyClass();
> >> }
> >> -------
> >>
> >> Then I called it
> >> ----tool
> >> MyClass class = logic.getServiceClass(parameter);  //line 1
> >> String x = class.getTitle();
> >> ...
> >> ----
> >>
> >> But it throwed ClassCastException right at line 1. I have searched on
> internet and some people said It got something to do with "classloader". I
> guess MyClass in myapp and MyClass in myservice had been loaded into
> different libraries ( eventhough they have same code). I can't think any
> solution here. Could somebody give me some suggestions?
> >>
> >> Many thanks !
> >>
> >> Le Nguyen Thach
> >> _______________________________________________
> >> 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"
> >
>
> _______________________________________________
> 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/20100726/cc8b470e/attachment.html 


More information about the sakai-dev mailing list