See my comments below. On 21 Jan 2003 at 12:18, Vuko Brigljevic wrote:
> Hi Scott, > > Thanks for your help! > > Scott Nichol wrote: > > > 1) Clearly, for any service method that is executed, the byte code > > must be loadable, which means it must be somewhere that a Tomcat > > class loader can access it. If the code cannot be found, Apache SOAP > > would return a SOAP Fault to the client. > > O.K, that seems obvious; agreed. > > > Almost always, the classes implementing services should be in the > > Apache SOAP webapp. Depending on what dependencies the service > > classes have, they may also work from $CATALINA_HOME/lib or > > $CATALINA_HOME/classes. > > so you mean the class implementing a SOAP service has in > principle to be in the directory $CATALINA_HOME/webapps/soap > (or $CATALINA_HOME/{lib|classes}). > Do I understand this right? Yes. > I was able to get it working differently for a simple testing > purpose: the byte code of the class implementing a SOAP service > was in the ~/soap-example directory, and I added by hand that > directory to the tomcat classpath in the script > $CATALINA_HOME/bin/catalina.sh You would find that the Tomcat docs discourage you from doing this. With your custom code, you can get away with this if the code does not have dependencies on other classes used by Tomcat (such as XML parser). > I guess that's not really the way you're supposed to be doing > it, so my question: > > - I have a full web applications, let's call it <mywebapp> > with its WEB-INF/ directory and classes/ and lib/ subdirectories, > a deployment descriptor web.xml. It contains as well servlet > as other Java classes. > - I want to expose some methods of some of these classes (in principle > not servlet classes) as SOAP services, and I have written the > deployment descriptor for these. > - What is the correct way to deploy <mywebapp>? Put it in the > $CATALINA_HOME/webapp/soap/ subdirectory? And so merge my > web.xml file with the soap/WEB-INF/web.xml file? I would > honestly prefer to have <mywebapp> in a subdirectory on > its own. In that case I wouldn't have to care about the stuff > not regarding <mywebapp> in web.xml for example. You have <mywebapp> and also a webapp for Apache SOAP, and you want some classes used by <mywebapp> to also be available as services under Apache SOAP. One alternative is to have duplicate copies of the classes in each webapp. That may be a configuration management nightmare. Another alternative is to put the "shared" classes in $CATALINA_HOME/[lib|classes]. The remainder of your <mywebapp> classes go in the <mywebapp> directory tree. > - I actually tried to have it in a directory on its own and added > a special context for that $CATALINA_HOME/conf/server.xml: > > <Context path="/quotation" > docBase="/home/vuko/soap/soapuser-1.0/web" > crossContext="true" > debug="0" > reloadable="true" > trusted="false"> > </Context> > (I am actually trying to run the example found at: > http://www.soapuser.com/server4.html but without > IDE: I am compiling and moving files "by hand" and > that's where I am failing) > > but that seems not to work: when I try to make a client > call to the service, tomcat does find the service but > cannot resolve a class located in the same package (and > directory) as the service: > > Generated fault: > Fault Code = SOAP-ENV:Client > Fault String = Deployment error in SOAP service > 'urn:QuotationService': class name > 'com.soapuser.soap.server.quotation.Quotation' could not be resolved: > com.soapuser.soap.server.quotation.Quotation > > What am I doing wrong, how am I supposed to do it? Let me > know if you need further details to understand what I am > trying to do. I do not know exactly what is going wrong here, possibly because I do not have experience with crossContext="true". > > Vuko > > -- > ===========================================================| > Vuko Brigljevic, EP Research Fellow | > CERN - European Laboratory for Particle Physics | > --------------------------------------------------------- | > Mail Address: CERN, Div. EP, 1211 Geneve 23 (Switzerland) | > Office : B40-2B08 | > Phone : +41-22-767 1662 | > e-mail : [EMAIL PROTECTED] | > www : http://www.slac.stanford.edu/~vuko | > ===========================================================| > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> > > Scott Nichol -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>