In this document,
package org.greenstone; public class UsernameService { public String getUsername() { return "pinky"; } }Compile it. (Say in Eclipse.)
ant deploy-localsitethe file $GSDLHOME/web/WEB-INF/server-config.wsdd would have been generated. It would contain one or more <service> elements.
Stop Greenstone's tomcat:
ant stopCopy an existing <service> element in order to create a <service> element for your web service. In our example case, you could have:
<service name="UsernameService" provider="java:RPC"> <parameter name="allowedMethods" value="getUsername"/> <parameter name="className" value="org.greenstone.UsernameService"/> </service>NOTES:
<service name="MyWebServices" provider="java:RPC"> <parameter name="allowedMethods" value="*"/> <parameter name="className" value="org.greenstone.WebServices"/> </service>
ant startAnd now use Axis' AdminClient tool to deploy the web service by typing the following in the x-term from within the GSDLHOME folder:
java -cp $AXISCLASSPATH org.apache.axis.client.AdminClient -lhttp://YOURCOMPUTER:YOURPORT/greenstone3/services/AdminService web/WEB-INF/server-config.wsddChange the computer host and port to suit your situation. For example
java -cp $AXISCLASSPATH org.apache.axis.client.AdminClient -lhttp://harakeke:8080/greenstone3/services/AdminService web/WEB-INF/server-config.wsddCheck it says DONE PROCESSING or something like it.
http://localhost:8080/greenstone3/servicesand find the new service there. There will be a link to its WSDL file as well.