Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0

...

The rationale of using open standards such as webservices is that they promote interoperability. Using a client generated by the grouper-ws build process to test the server is great, but we need to go further to test using it with other implementations of webservices clients. The first one we're going to use is CXF, a popular alternative to Axis which is targetted more at modern java development idioms (preferring configuration over code, sensible defaults etc.). Here are the steps:

  • Download CXF from http://cxf.apache.org/download.htmlImage Removed (I'm using version 2.3.1, earlier versions have a library conflict which prevents wsdl2java working against the grouper wsdl file)
  • Extract the download to a directory - I'll be calling this CXF_HOME
  • Open a command line and go to CXF_HOME/bin (we'll be using the tools in this directory to auto-generate a client)
  • Download the wsdl file from your groups-ws installation (I'm assuming you've got it installed on Tomcat on your local machine listening on port 8080, with the default name for the webapp) at http://localhost:8080/grouper-ws/services/GrouperService?wsdlImage Removed You will need to autenticate to download it. Assuming you've got the tomcat-users.xml content from the quickstart in you TOMCAT_HOME/conf, use GrouperSystem/123. We are downloading the wsdl file because the CSX tools don't support authentication when retireving a WSDL file for client generation, so save the file to somewhere easy to get to.
  • In CXF_HOME/bin invoke the wsdl2java command with:

...

In your IDE you can now edit the generated client files that you imported to change the location of the WSDL file to the one on the server. To do this, open up GrouperService in the edu.internet2.middleware.grouper.ws.soap package, create a class and change the wdslLocation and url variables to point to http://localhost:8080/grouper-ws/services/GrouperService?wsdlImage Removed. This is not required (things will work perfectly well with the WSDL file saved locally), but it will make it easier to update. Now create a class in a test package and call it GetMembersSimple, add the code as follows:

...

The first conduit enables CXF to authenticate to retireve the WSDL file. The second to authenticate when executing methods against the web service. The documentation for conduits is at . The documentation at http://cxf.apache.org/docs/client-http-transport-including-ssl-support.htmlImage Removed would suggest the the second conduit is not required if the URL in the first is changed to include the whole web service, but I have found that it is.

...