[Building Sakai] Adding users details through WebService WSProflie.jws

Adrian Fish a.fish at lancaster.ac.uk
Mon Jul 26 04:14:27 PDT 2010


Hi Ahamed,

I use the RESTful interface to do this kind of thing. Have a look at this:

        my $user_profile = {
                                        
userUuid=>'fgfdg-4545gfg-df-gdfg-dfg',
                                        position=>'Dictator for Life',
                                        department=>'Government',
                                        personalSummary=>'I am a  
benevolent dictator. My people love me.',
                                        imageUrl => 
'http://www.mybeautifulpicture.org'
                                        };

        # Try and create the user's profile. If it exists already we 
leave it alone.
        my $profileres = 
$ua->post("http://localhost/direct/profile",$user_profile);

        if ($profileres->is_success) {
                print "Successfully created profile for '$name'\n";
        }
        else {
                print "Failed to create profile for '$name'.\n";
        }

The key part is the creation of the data to post, the user_profile hash.

Hope that helps.

Adrian.

Absar Ahamed wrote:
> Hello
>  
> Iam using sakai2.6.orc1 I have a problem in sakai webservice. In 
> WSProfile.jws file i can't able to add users details through perl 
> script. When i run script Its saying success in the end but its not 
> getting entered in the database. I added mobile number also in 
> WSProfile.jws file. I have attached WSProfile.jws file. And here is my 
> perl script
>  
> #!/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/WSProfile.jws?wsdl");
> $soap->updateUserProfile($sessionid,'22f3efca-d528-44ac-aef6-137ae7727148', 
> 'test1', '234','test1 at test.com <mailto:test1 at test.com>','007', 
> 'auto','',911234567890);
> if ($result->fault) {
> print "Error";
> } else {
> print "Success";
> }
>  
> right now i dont want to add users photo so i put null in the script
>  
> can any how do i resolve this issue
>  
> Thanks in advance
>  
> ------------------------------------------------------------------------
>
> _______________________________________________
> 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"

-- 
==================================
Adrian Fish
Software Engineer
Centre for e-Science
Bowland Tower South C Floor
Lancaster University
Lancaster
LA1 4YW
email: a.fish at lancaster.ac.uk

http://confluence.sakaiproject.org/display/YAFT/Yaft
http://confluence.sakaiproject.org/display/CLOG/Home
http://confluence.sakaiproject.org/display/BBB/Home

-------------- next part --------------
A non-text attachment was scrubbed...
Name: a_fish.vcf
Type: text/x-vcard
Size: 289 bytes
Desc: not available
Url : http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20100726/8eef6b19/attachment.vcf 


More information about the sakai-dev mailing list