Friday, September 17, 2010

Developing a webservice with Axis2 in Eclipse

1. Configure Axis2 in Eclipse (you need to download and unzip to a directory):



2. Ensure you select "Generate an interface for the skeleton".


3. Configure a server runtime to deploy the web service:

ensure you check "create a new local server"





3. Create a new "Dynamic Web Project"





Under Configuration click "Modify" and ensure that Axis2 Web Service is selected.





4. Create a new class eg. PartyId and add in the methods

5. Create a WebService



Ensure you choose Axis2 Runtime







6. Run on the server





An error appears: change the url to : http://localhost:8080/PartyIdService/axis2-web/index.jsp


7. If error:

Edit the web.xml from the WEB-INF directory:






Change org.apache.axis2.transport.http.AxisServlet to
org.apache.axis2.webapp.AxisAdminServlet
(ensuring you are changing for Apache-Axis Admin Servlet Web Admin)





If asked for password, user : admin password : axis2


8. If successful, you should the following screens:

Axis2 Links

I've found several very simple and good links on Axis2:

1. Very simple bottom up tutorial.

2. A whole bunch of articles and links

3. Using complex objects

4. Axis2 and Tomcat

5. Exposing a Database as a Web Service

Saturday, September 11, 2010

Configuring Glassfish with log4j

Here's how you do it:

1. Place log4j.jar and log4j.properties file somewhere :
I put mine:
M:/Development/Java/glassfish/lib/log4j-1.2.15.jar
M:/Development/Java/glassfish/domains/domain1/lib/logging
2. Add the fully qualified path to the log4j.jar into the classpath of Glassfish together with the directory that contains the log4j.properties file. You can do that in the web UI: Application Server/JVM Settings/Paths/System Classpath and the entries are separated by a return.

3. Restart the server - if you are in asadmin, you need to exit and enter again.
Or else just do asadmin stop-domain and then asadmin start-domain