You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-dev@xml.apache.org by Dan Mandell <dm...@stanford.edu> on 2001/05/06 22:57:03 UTC

SOAP with Tomcat

Hi all,

I'm trying to send a SOAP message to the AddressBook sample service running
inside Tomcat. I believe the sample files are all deployed correctly
because I can run the "testit.bat" script succesfully. To send the message,
I have a simple JSP file that uses the iotags custom tag library from
jakarta. Here's the JSP:

<%@taglib uri="http://jakarta.apache.org/taglibs/io/1.0" prefix="io" %>
<%@page contentType="text/xml" %>
<io:soap
    url="http://morning-glory.stanford.edu:8080/soap/servlet/rpcrouter"
    SOAPAction="urn:AddressFetcher">
<io:pipe>
  <SOAP-ENV:Envelope
    xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <SOAP-ENV:Body>
      <m:getAllListings xmlns:m="urn:AddressFetcher">
      </m:getAllListings>
    </SOAP-ENV:Body>
  </SOAP-ENV:Envelope>
</io:pipe>
</io:soap>

But when I run this JSP, I get a java.io.FileNotFoundException:
http://morning-glory.stanford.edu:8080/soap/servlet/rcprouter:
at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.jav
a:545)
	at org.apache.taglibs.io.URLTag.getURLInputStream(URLTag.java:238)
	at org.apache.taglibs.io.URLTag.getURLReader(URLTag.java:231)
	at org.apache.taglibs.io.URLTag.readURL(URLTag.java:288)
	at org.apache.taglibs.io.URLTag.doEndTag(URLTag.java:171)
	at
_0002faddr_0002ejspaddr_jsp_6._jspService(_0002faddr_0002ejspaddr_jsp_6.java:118
)

etc...

What's interesting is if I do a "GET" instead of a "POST" (the io:soap tag
uses POST), I can get the "you can only talk to the rpcrouter servlet with
a POST request, not a GET request" message, so I know the JSP and the
rpcrouter servlet are in communication. I only get the above exception with
a POST like in the io:soap tag, though if I create a simple html page that
sends a POST through a form, the rcprouter servlet responds with a SOAP XML
message with a soap-fault saying the request was of the wrong type, as
expected.

I have tried this using Tomcat 3.1.1 and 3.2.2b4 with the same result. I
couldn't get SOAP running on either Tomcat 3.2.1 or 4.0b3.

Both the JSP and the SOAP webapp are running in the same Tomcat container
simultaneously.

Thanks so much for any insight you can offer!

Dan