axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Galbreath, Mark A" <Galbreat...@state.gov>
Subject RE: Webapp Deployment to Directory Other Than Axis
Date Mon, 26 Apr 2004 21:00:40 GMT
Hey Jerry!

Yeah, I miss struts-users, but the traffic got to be so burdensome I had to
unsubscribe.  The guys on this list are pretty cool, though.  A core of us
continue to collaborate online in a variety of Java and open source
technologies at irc.darkmyst.org #funkycodemonkey.  cya there if you IRC.

Man! What a friggin hassle for a simple echo form!!!  I have been struggling
with getting an browser-aware Web service all day using just a servlet
(start simple) to return HTTP header data and I'm at the point where you
begin the last paragraph of your instructions below.  I'll adapt those to my
config and let you know.  Thanks for the help!  Who would have thought that
"Web" services would be such a PITA to implement in a Web browser!

BTW: I'm using JBuilder 9.0 Enterprise (soon to be X) -> I have to use the
same toolset the original development team used on this massive conversion
project.  But it's cool - it is very Web services savvy, including built in
Java2WSDL/WSDL2Java and wsdd engines.  Your tax dollars at work!  Speaking
of which, the Dept is sending me to JavaOne this June...hehehe.

BTW:  I work for the US Department of State now doing work that eventually
will be used in Baghdad (if I can figure out this can of worms).  What a
hoot, eh?

Catch ya l8r...it's Miller Time!
Mark

-----Original Message-----
From: Jerry Jalenak [mailto:Jerry.Jalenak@LABONE.com]
Sent: Monday, April 26, 2004 4:04 PM
To: 'axis-user@ws.apache.org'
Subject: RE: Webapp Deployment to Directory Other Than Axis


Mark - 

Glad to hear from you again.  After you dropped off the Struts list, life
just wasn't the same......  8-)

Anyway, I've also started learning Axis, and have gone through much of the
same pain.  I'm using Eclipse as my IDE, so everything that follows is
applicable to that environment.  You can probably make it work in any IDE -
I don't know, I haven't tried.   In order to make this work, you will also
need the 'wsdl2java' importer (attached).  Install this into your plug-ins
directory.  Anyway, here goes....

1. Detach and unzip the 'Axis' attachment and drop it in your workspace.  I
have yet to find a way to deploy a webservice that doesn't live under the
Axis directory.  This is a *very* basic HelloWorld webservice.  Under the
'example' package you will find an interface (HelloWorld), and
implementation (HelloWorldImpl), and a wsdl folder.

2. Detach the 'HelloWorld deploy.txt, HelloWorld Java2WSDL.txt, and
HelloWorld WSDL2Java.txt attachments, and place them on your desktop.
You'll use these to generate the wsdl, the java stubs, and the deployment
scripts.

3. Detach and unzip the 'wsTest' attachment and drop it in your workspace.
This is a *very* basic Struts app that you will use to connect to the
HelloWorld webservice.

OK - having got all of that, here's how to make it work:

Start up eclipse, and create new Tomcat projects for the 'Axis' and 'wsTest'
projects.  This will also compile the projects.  Once this is done, open up
a DOS prompt and cd to c:\eclipse\workspace\axis (be sure to allow for your
directory structure).  Open up a notepad session, and from your desktop,
open the HelloWorld Java2WSDL.txt file.  Highlight everything in it,
copy-paste to the DOS window, and run it.  When it complete, you can refresh
your 'Axis' project in eclipse, and you should find a HelloWorld.wsdl in the
example/wsdl folder.  Go back to the notepad session, open the HelloWorld
WSDL2Java.txt file, highlight everything in it, copy-paste to the DOS
window, and run it.  When it completes, you can refresh you 'Axis' project
(again) and should find a bunch of java files under example/wsdl2java.  One
of these will be called HelloWorldSoapBindingImpl.  Open this file up, and
edit it so it looks like the following:

/**
 * HelloWorldSoapBindingImpl.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis WSDL2Java emitter.
 */

package webservices.example.wsdl2java;

import webservices.example.HelloWorldImpl;

public class HelloWorldSoapBindingImpl implements
webservices.example.wsdl2java.HelloWorld{
    public java.lang.String getHelloWorld(java.lang.String in0) throws
java.rmi.RemoteException {
	HelloWorldImpl hw = new HelloWorldImpl();
	return hw.getHelloWorld(in0);
    }

}

If you are using the Sysdeo plugin for Tomcat, be sure that the 'Axis'
project has updated the server.xml, and then start Tomcat.  Once Tomcat is
up, you should be able to go to your browser and enter
http://localhost:8080/axis/service/HelloWorld and get back a page that says
an Axis webservice is running here.  Adding the ?wsdl to the end will
display the wsdl for the service also.

OK.  In the 'wsTest' project, click on the WEB-INF/src folder, right click,
and select 'import'.  If you installed the wsdl2java importer, you will find
an import option of 'Import Web Reference'.  Clikc on 'Next', enter
'http://localhost:8080/axis/services/HelloWorld?wsdl' in the URL to WSDL
field, and click 'Finish'.  When the import completes, you can refresh your
'wsTest' project, and you should find a package called 'HelloWorld_pkg'.
Organize imports, and re-compile the HelloWorldAction.  Be sure that Tomcat
knows about the wsTest (updated server.xml).  You should know be able to go
to your browser, and enter http://localhost:8080/wsTest/index.jsp. This is a
simple form that has an input box and a submit button.  Enter any text in
the input box, and click 'Submit'.  With luck, you should get a line back
that says 'Hello <whatever you entered> !!!'.  


Good luck.  I don't think I've missed anything, but if you can't get it to
work, let me know.


Jerry Jalenak
Development Manager, Web Publishing
LabOne, Inc.
10101 Renner Blvd.
Lenexa, KS  66219
(913) 577-1496

jerry.jalenak@labone.com


> -----Original Message-----
> From: Galbreath, Mark A [mailto:GalbreathMA@state.gov]
> Sent: Monday, April 26, 2004 11:45 AM
> To: 'axis-user@ws.apache.org'
> Subject: RE: Webapp Deployment to Directory Other Than Axis
> 
> 
> Thanks, Nikki, got the archive and, disappointingly (at least 
> as of June 2003), there is no de facto standard way of doing 
> it, so I guess my outline below will serve as a roll-yer-own 
> for me.  I don't like the idea of using client-side scripting 
> to do this, and I sure as hell don't want to use ActiveX.  
> JSPs are alright, but violate my sense of MVC.  So it looks 
> like the Axis 1.2beta and Servlets 2.3 APIs.....
> 
> Thanks for the clue, though!
> Mark
> 
> -----Original Message-----
> From: NJ Rogers, Learning and Research Technology
> [mailto:Nikki.Rogers@bristol.ac.uk]
> Sent: Monday, April 26, 2004 12:05 PM
> To: axis-user@ws.apache.org
> Subject: Re: Webapp Deployment to Directory Other Than Axis
> 
> 
> Hi
> 
> > 1.  All the examples so far run the client class from the 
> command line;
> > this is clearly inadequate for Web applications.  Why can't 
> I find any
> > totorials/example code that actually uses a browser?  I 
> assume the browser
> > URL would link to a servlet which would acts as a 
> controller between view
> > and model, and the model contains the logic to invoke Axis 
> methods.  A
> > more realistic example than simple command-line public 
> static void Main(
> > String[] args ){} would be extremely helpful.
> >
> There was a thread "Calling a web service from a browser" 
> related to this 
> last year - June 2003. You might be able to find it in the archives,
> 
> Nikki
> 
> 
> 
> ----------------------
> NJ Rogers, Technical Researcher
> (Semantic Web Applications Developer)
> Institute for Learning and Research Technology (ILRT)
> Email:nikki.rogers@bristol.ac.uk
> Tel: +44(0)117 9287096 (Direct)
> Tel: +44(0)117 9287193 (Office)
> 


This transmission (and any information attached to it) may be confidential
and
is intended solely for the use of the individual or entity to which it is
addressed. If you are not the intended recipient or the person responsible
for
delivering the transmission to the intended recipient, be advised that you
have received this transmission in error and that any use, dissemination,
forwarding, printing, or copying of this information is strictly prohibited.
If you have received this transmission in error, please immediately notify
LabOne at the following email address: securityincidentreporting@labone.com

Mime
View raw message