0
votes

I am using Axis2 (1.5.3 currently) and Tomcat (6.0.26 currently) and am running a web service. I would like to also host HTML pages for configuring the web service.

What is the best way to go about this? I assume keeping the same context is key, but perhaps it is not.

My current distribution is located under a folder structure similar to this: Tomcat/webapps/mycompany With the actual service code here: Tomcat/webapps/mycompany/WEB-INF/services/myService

In a browser, I can hit my web service by going to here: /mycompany/services/myService

I note that I can drop actual HTML files in this path and Tomcat will, indeed serve them up.

For instance, if I put "index.html" under Tomcat/webapps/mycompany, I can navigate to /mycompany/index.html and see my html.

What I want to do is have this HTML be attached to JAR/class files that can interact with the already-existing service class files in the same context as the service. Therefore, I can have the browser configure the web service directly.

Is this possible, and is there a tutorial or something out there that will help me with this? Note that I have been working with Tomcat and Axis2 for a while now for this particular web service, but I have never actually deployed a web application/html using Tomcat before.

Thanks.

2
One alternative that I'm considering is to have the HTML simply do all interaction with the web service directly using AJAX. These web service methods would have to be localhost only, if that's even possible (I imagine it is?). -- Is there a good freeware/open source AJAX framework out there with full SOAP support?Anthony
Did you see that Axis2 already comes with an integrated Service browser and administrator tool?seba.wagner
If you still persist to build your own one I would propably use: archive.plugins.jquery.com/project/jqSOAPClient however this will only work as long the server and client respect the same origin rule.seba.wagner
I am not trying to configure Axis itself, but the data sources that the service is using.Anthony

2 Answers

0
votes

First of all what do you mean by a configuring a service. Normally in SOA world services are analogous to interfaces. IMHO you can just change a service, since their are other users that rely on the services you are exposing.

If i want to change a service i would rather introduce a new version of the service after deprecating the existing one.

Are you talking about applying QoS to existing serviecs. Then that makes sense.

Anyway, If you want to have a web-app alongside with axis2 service engine, it is possible. If you look inside the axis2 war file you'll find the web.xml entry to Axis2Servlet. It is this servlet that serves the web services requests.

So, what you need is the Axis2Servlet mapping in your web-app along with your usual servlet-mappings. Number of possible ways to configure your services using web-app files. One options is to use web-services call itself to (with authentication) to configure it.

0
votes

By "configure a service", take this example:

The service has a set of datasets.
Each dataset exists in a separate database. The service can manage 0..n datasets. The service must be configured to know about each dataset.

This is what I'm configuring. I'm not trying to configure Axis itself or redefine the service.

I would like to host the HTML using the same instance of Tomcat that I'm hosting the web service with. It needs to manage sessions, have login capability, an whatnot, and has to be able to configure the web service live.

From what I'm reading, it's probably best to make an interface to the web service that the web application module can call into from a different context.

Is there a better way?