How to deploy an Axis-generated soap service to an embedded Tomcat instance - web-services

I generated a Soap Service from a WSDL and now I need to deploy it to my existing application which uses embedded tomcat (I.E. I have a class which extends TomcatServeletContainer and a main class which instantiates that class and starts the server).
I see many examples for how to deploy an axis service to a standalone tomcat using a WAR, or a WSDD, but I don't see how to wire it together myself. I assume I have to define a servelet in the web.xml and provide some other glue. Any assistance or pointers to appropriate documentation would be most appreciated.
Thanks!
-Carl

Have you been able to get this to work?
I've been trying to build a webservice (in a standalone war-file containing the axis jars (w/dependencies)+server-config.wsdd) using maven. I really don't want to make any calls to the AdminClient at all (meaning not to install Axis).
I've generated the server side sources from a WSDL using the axistools-maven-plugin, and everything seems to work ok until I have deployed the service. http://localhost:8080/myApp/services gives me the name of the service and two exposed methods. But clicking the wsdl link displays an Axis error message telling me "Could not generate WSDL! There is no SOAP service at this location".
Is it at all possible to build a standalone Axis webservice this way using maven?

Yes, you will need build your application the same way you would for a WAR but programmatically inform tomcat where you exploded war lives.
Everything else should be the same as the standard servlet spec.

Related

Jetty vs Weblogic Axis Response deserialization difference

I am testing my application with both Jetty(Eclipse) & Weblogic. I am calling an axis web service, receive a response and deserialize it. While everything works like a charm in Jetty, when I pack & deploy my application to weblogic I receive
org.xml.sax.SAXException: Invalid element in
com.xxx.yyyy.soa.schemas.INVOICE_ITEMType - CHARGE_TYPE
I am sure, both call the same Web service URL.
I decompiled the INVOICE_ITEMType class at war that I deploy to weblogic and made sure there is CHARGE_TYPE at INVOICE_ITEMType class.
What should I do to further investigate the case? I am stuck
Thank you
Finally realized that it is a classloader issue. My application unfortunately calls different web services from same third party company, whose interfaces re-uses same named-packeged objects with different implementations.

Having RESTful service in RCP application

We have an existing eclipse RCP application that works as a standalone product. At a high level, this product is used to configure a image specification using its UI and we can export a sample Image based on these configuration.
Now we are developing another web application that has several modules and one module of it is to develop something that our eclipse RCP application does.
Just to provide a QUICK integration of the RCP application for demo purpose, I plan to run the RCP application separately in the server machine and expose its static functionality as a RESTful webservice. So the module shall make a RESTful call to the RCP application.
Now just to begin with I tried to embed a jetty server for hosting the REST service during the start of RCP application like below
But the thing is after the Jetty server is started I am not able to access the TestWebService using the path i configured. So I am confused if this is the right approach to have a RESTful service inside a RCP application. Please note that iam able to hit the server with http://localhost:1002, but not the service.
Following is the console log when i hit on http://localhost:1002/hello/test:
It's a really weird architecture you're experimenting with.
I mean to write an RCP-application which listens on a port and offers REST services on it; this could lead to further obstacles.
Instead I would seperate it into two software artifacts: an RCP-app and a web-application (.war).
You could extract a business-logic jar (It can be an OSGi plug-in if necessary) contaning your image manipulation logic.
Then include this plug-in/.jar as a dependency in the webapp and offer out it's functionalities thru a Web-container (Tomcat, GlassFish, etc.)
So your other (third) application will connect to the Web-services offered by this .war file.
opt.1) If you need a single running instance (because of database or other shared resource) then your RCP-app will have to use this REST service too.
opt.2) If not then simple compile the .jar/plug-in containing the business-logic into your RCP-app.

Apache ODE BPEL Deployment with a webservice (file transfer)

I'd like to write a axis2 webservice for deploying BPEL Processes on a Apache ODE.
At the moment I have two main issues/questions.
I wrote a simple WS that creates a file.
It works fine in eclipse with a integrated apache tomcat with axis2.
But if I run the service on the exact same server without ecplise it won't work and I get 'Unhandled IOException' Errors, although I have the handling implemented (otherwise ecplise would cry about it all the time).
EDIT: I solved it by not uploading the service.aar with axis2 but putting it in the /webapps folder.
How do I get access to the folder were I need to put the BPEL files?
Is it obligatory that the service runs on the same server as the ODE?
EDIT: Getting access to the folder on the same server is an easy one with 1.
How do I transfer files with a webservice?
Better: How do I implement it?
Regarding 2) you can use the deployment API exposed by ODE. This allows for transfering deployment units (zip files containing BPELs, WSDLs, DDs) via SOAP to ODE and starting the deployment.
The WSDL is available at http://.../processes/DeploymentService?wsdl, on the default installation that would be http://localhost:8080/ode/processes/DeploymentService?wsdl

Webservice, Axis & OSGI (knopflerfish)

I first warn you because I'm a beginner. So, I don't know if I'll be specific on all points. Here is my problem:
I have a wsdl file. Currently, I use Tomcat and Axis to deploy it. So for that, I use the wsdl2java tool of axis that generates me the "skeleton" of the webservice. And then I write on the generated files the code of the various methods of the webservice. Finally, I deploy the webservice on tomcat with Axis. Everything seems to work more or less.
The problem is that I want to deploy this webservice using the bundle axis of osgi (knopflerfish). But I don't know how to do it.
Should we use again the wsdl file and generate a code with a tool like wsdl2java but adapted to knopflerfish? or should I use the "skeleton" that I've created before with Axis and adapte it for osgi? And generally speaking, how can we use the axis bundle of knopflerfish?
To be honest, I do not find many things over internet about it. So that's why I write to the community :(
Thank you in advance for your help.
Found a article on http://www.ibm.com/developerworks/webservices/library/ws-OSGi/ for deploying a Webservice as OSGI bundles. This uses Eclipse Equinox as the OSGi container and Apache CXF as a web services framework and its deployed in Apache Servlet Container.Hope this meets requirement of depolying Webservices as OSGI service .

Using Axis to generate a web service implementation that calls another web service

I need to provide an implementation of a web service for which I have the WSDL, to run under Weblogic 9.2.
I aim to use the Axis (1, not 2) tools for this , having tried and failed to make it work with thw weblogic web service generation tools (due to an inability to set the authentication - see my other question here),
This web service needs to make calls to another web service (for which I also have the WSDL).
I can use the Axis tools to generate the client stubs etc.
But how do I do the two in combination? Is there a tutorial or other step by step guide? I have googled and found some mailing list postings, but they're about specific issues.
If someone's done it, could they share the relevant parts of their build.xml for this?
If I used the weblogic web service generation tools, there's a tool that in one go generates the skeleton implementation of the web service and the client stubs for the web service it calls - is there something similar in Axis?
Any gotchas if I just try to mash up the skeleton and client generation output from WSDL2Java?
Update:
Got this to work.
Used the Eclipse tools to build the client, then the service, allowing the second to overwrite the duplicate files from the first. We then had some issues with the client_deploy.wsdd file (see my other question How do I refer to a client_deploy.wsdd file that's in WEB-INF?) and with jar versions (needed to update the jars that Axis uses to newer version), then it just worked.
Speaking for axis2, you can create the client stub like this (I reckon axis1 is not much different):
/wsdl2java.sh -uri webservice.wsdl -p com.your.client.package -d adb -s -o output_folder_client
Once you have the client package you should be able to use it in your own webservice implementation by just importing it, creating a client instance and submitting requests.