Re: SOAP and servlets living together?

From: Bryan Castillo (rook_5150_at_yahoo.com)
Date: 10/28/04


Date: 27 Oct 2004 21:14:40 -0700

unix.hack@gmail.com (unixhack.blogspot.com) wrote in message news:<7d46b4f8.0410262129.400f2ae6@posting.google.com>...
> Hi,
>
> I'm trying to develop an application that uses SOAP and servlets.
> So far I have some servlets and JSP's running fine. They access
> the database, modify it, display data, etc.
>
> I want to add some SOAP functionality to the application using
> Apache SOAP, but so far I haven't had much luck. I am following
> the Apache SOAP docs and the Tomcat/SOAP instructions at:
>

I don't think that Apache SOAP has been updated for quite awhile and I
would reccomend you use Apache Axis. http://ws.apache.org/axis/

I was able to get Axis to work inside of a web app. It comes with a
web application, however you do need to download the JAF jar from sun
and put it into the webapps WEB-INF/lib directory. Once you get that
working its pretty easy to merge the stuff in the Axis WEB-INF/web.xml
into your own webapps web.xml. You have to copy the libs of course
and I think there is a file wsdd.config? (if you have already deployed
some services to the web-app)

For simple stuff services in Axis, check out the jws deployment (its
very cool).

> http://www.onjava.com/pub/a/onjava/2002/02/27/tomcat.html
>
> So far I have modified catalina.sh to
>
> - add xercesImpl.jar at the beginning of the CLASSPATH
> - add the path to my soap classes at the end of the CLASSPATH
>
> This works, and I am able to deploy the sample SOAP service
> from the OnJava example using the ServiceManagerClient class.
>
> This would be fine if I didn't had to access the classes I
> already wrote. Which is not the case.
>
> So, I add the directory where my classes live at the end of
> the CLASSPATH in catalina.sh. This directory look something like:
>
> $CLASSPATH:$CATALINA_HOME/webapps/myapp/WEB-INF/classes
>
> This allows the SOAP service to access public methods provided
> by my application. However, if I now try to access my application
> via the usual URL (http://my.host.com:8080/myapp), I get a 404
> error!
>
> The Tomcat log shows a somewhat cryptic stack trace:
>
> Oct 26, 2004 6:35:58 PM org.apache.catalina.startup.HostConfig deployDirectories
> SEVERE: Error deploying web application directory myapp
> java.lang.NoClassDefFoundError: javax/servlet/http/HttpServlet
> at java.lang.ClassLoader.defineClass0(Native Method)
> at java.lang.ClassLoader.defineClass(ClassLoader.java:539)
> at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:12
> 3)
> at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
> at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
> at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
>
> ... and so on and so forth, without any reference to any of the
> classes I actually wrote. BTW this
>
> At this point, I'm completely stumped. Any idea of how to get
> SOAP and servlets to live together?
>
> Should I ditch the whole ServiceManagerClient/ RPC router
> thing and just chisel the SOAP functionality into my classes?
>
> If this is not the best forum to ask this type of questions, could
> you please recommend some other place to go?
>
> Thanks a lot if you read this far, and thanks in advance for any help,
>
> Ernesto



Relevant Pages

  • Re: Servlet To Java Application Communication
    ... > The main reason is because I want to use the SOAP protocol to exchange ... And Tomcat supports SOAP ... > SOAP messages with Tomcat unless I use servlets. ...
    (comp.lang.java.databases)
  • Re: Can I use servlets WITH ASP.Net 2.0 ?
    ... The servlets contain the bulk of my 1st 2 layers in a 3 tier architecture - i.e. data layer and business logic layer respectively. ... The obvious "bridge" would be SOAP, but I want a more tightly couple system than that - i.e. ... I do not want to wrap up the servlets in yet another layer of abstraction - since they already wrap around my C++ code... ...
    (microsoft.public.dotnet.framework.aspnet)
  • SOAP and servlets living together?
    ... I'm trying to develop an application that uses SOAP and servlets. ... This allows the SOAP service to access public methods provided ... Error deploying web application directory myapp ...
    (comp.lang.java.programmer)
  • Re: Servlet To Java Application Communication
    ... And Tomcat supports SOAP ... exchange SOAP messages with Tomcat unless I use servlets. ...
    (comp.lang.java.databases)
  • Re: org.xml.sax.SAXException error when calling a java webservice
    ... For complex data types, ... It may help you to use the AXIS tcpmon tool, or simon fell's proxytrace, to ... Compare the soap generated by the VB ... objects (mytype) to fit your needs. ...
    (microsoft.public.dotnet.framework.webservices)