access Web services from java

access Web services from java

by chirag jani -
Number of replies: 7

Hi All,

Currently  facing to find the wsdl url to access the web services from the java . so can anyone sent some code to implement this.

 

Average of ratings: -
In reply to chirag jani

Re: access Web services from java

by Patrick Pollet -
Hi,
As far as I know the current Moodle 2.0 Web Service API is not compatible with Java or .NET .
See http://docs.moodle.org/en/Web_services_FAQ#Does_the_Moodle_SOAP_server_work_with_JAVA_or_.NET.3F
If you must use java for your client you should have a look to OK Tech WS that runs under Moodle 1.9 and 2.0 see http://docs.moodle.org/en/Web_Services:OK_Tech_Web_Services
Cheers.
In reply to chirag jani

Re: access Web services from java

by Gerwood Stewart -

Patrick is right. The native 2.0 web-services currenlty don't work with Java, .NET (and ruby it would appear).

In answer to the question you asked though you can get the wsdl pretty easily.

the url is roughly the following: http://moodle-url/webservice/soap/server.php?wstoken=--add-your-token-here--&wsdl=1

 

Good luck with it.

In reply to Gerwood Stewart

Re: access Web services from java

by chirag jani -

Hi,

Thanks for your answer.

As per url given by you  how we get wstoken to access the wsdl & also want to know that there is some other option to access web service?

 

Thanks

Chirag

In reply to chirag jani

Re: access Web services from java

by Bill Antonia -

Hi,

FYI. Got back to this project, other things got in the way.

I'm currently in the process of creating a library of Java classes and methods to link into the REST web services of Moodle 2.0. So far I have all the User and Course functions working, the Group and File ones still to do. Just one observation, not a criticism, it's not very RESTful ;).

I'm going to use this library and my CommandReporter Java library to sync users and classes with SIMS.

Regards

Bill

In reply to chirag jani

Re: access Web services from java

by Bill Antonia -

Hi,

Just uploaded code to SourceForge containing the Java library and source code I have developed for accessing Moodle 2.0 REST web services from Java. Hope this helps. Does not get wsdl information but if you know what is being supported you don't need wsdl data.

By the way, it currently does not support File services and does not support extended User data. Token is the only authentication at present.

http://moodlerestjava.sourceforge.net

Regards

Bill

In reply to Bill Antonia

Re: access Web services from java

by Bill Antonia -

Updated the library on sourceforge, a couple of fixes and a few changes.

Note: this library uses the standard web services provided from a Moodle 2.0 install.

http://moodlerestjava.sourceforge.net

In reply to Bill Antonia

Re: access Web services from java

by Bill Antonia -

Hi,

I have updated the REST Library. A bug fix for the username/password authentication. Forgot to add an & between wsusername and wspassword parameters. Thanks goes to César who pointed this out.

A few other changes but not major.

http://moodlerestjava.sourceforge.net

I am looking into creating another library for SOAP using SAAJ. Initial testing has worked well.