You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-dev@ws.apache.org by km...@locus.apache.org on 2000/10/17 14:03:42 UTC
cvs commit: xml-soap/java/webapps/soap/WEB-INF web.xml
kmitchell 00/10/17 05:03:42
Modified: java/samples/addressbook DeploymentDescriptor.xml
java/samples/calculator DeploymentDescriptor.xml
java/samples/messaging DeploymentDescriptor.xml
java/samples/stockquote DeploymentDescriptor.xml
java/src/org/apache/soap Constants.java Fault.java
SOAPException.java
java/src/org/apache/soap/server DeploymentDescriptor.java
java/src/org/apache/soap/server/http
MessageRouterServlet.java RPCRouterServlet.java
ServerHTTPUtils.java
java/webapps/soap/WEB-INF web.xml
Log:
Submitted by: Eric Dashofy, Kevin Mitchell
Reviewed by: Kevin Mitchell
Changes to implement fault processing logic in rpc and message router servlets as discussed on soap-dev.
Also made ServerHTTPUtils a public class with public methods so it can be accesed by
custom server implementations (i.e. HTTP processors other than rpcrouter and message router)
Revision Changes Path
1.8 +3 -0 xml-soap/java/samples/addressbook/DeploymentDescriptor.xml
Index: DeploymentDescriptor.xml
===================================================================
RCS file: /home/cvs/xml-soap/java/samples/addressbook/DeploymentDescriptor.xml,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- DeploymentDescriptor.xml 2000/08/08 06:27:38 1.7
+++ DeploymentDescriptor.xml 2000/10/17 12:03:38 1.8
@@ -5,6 +5,9 @@
methods="getAddressFromName addEntry getAllListings putListings">
<isd:java class="samples.addressbook.AddressBook" static="false"/>
</isd:provider>
+
+ <isd:faultListener>org.apache.soap.server.DOMFaultListener</isd:faultListener>
+
<isd:mappings>
<isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:x="urn:xml-soap-address-demo" qname="x:address"
1.5 +1 -0 xml-soap/java/samples/calculator/DeploymentDescriptor.xml
Index: DeploymentDescriptor.xml
===================================================================
RCS file: /home/cvs/xml-soap/java/samples/calculator/DeploymentDescriptor.xml,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- DeploymentDescriptor.xml 2000/08/01 21:18:33 1.4
+++ DeploymentDescriptor.xml 2000/10/17 12:03:39 1.5
@@ -23,4 +23,5 @@
}
</isd:script>
</isd:provider>
+ <isd:faultListener>org.apache.soap.server.DOMFaultListener</isd:faultListener>
</isd:service>
1.2 +2 -0 xml-soap/java/samples/messaging/DeploymentDescriptor.xml
Index: DeploymentDescriptor.xml
===================================================================
RCS file: /home/cvs/xml-soap/java/samples/messaging/DeploymentDescriptor.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DeploymentDescriptor.xml 2000/09/01 02:46:24 1.1
+++ DeploymentDescriptor.xml 2000/10/17 12:03:39 1.2
@@ -5,4 +5,6 @@
methods="purchaseOrder bustedRequest XXX">
<isd:java class="samples.messaging.POProcessor" static="false"/>
</isd:provider>
+
+ <isd:faultListener>org.apache.soap.server.DOMFaultListener</isd:faultListener>
</isd:service>
1.6 +1 -0 xml-soap/java/samples/stockquote/DeploymentDescriptor.xml
Index: DeploymentDescriptor.xml
===================================================================
RCS file: /home/cvs/xml-soap/java/samples/stockquote/DeploymentDescriptor.xml,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- DeploymentDescriptor.xml 2000/08/17 20:35:50 1.5
+++ DeploymentDescriptor.xml 2000/10/17 12:03:40 1.6
@@ -5,4 +5,5 @@
methods="getQuote">
<isd:java class="samples.stockquote.StockQuoteService"/>
</isd:provider>
+ <isd:faultListener>org.apache.soap.server.DOMFaultListener</isd:faultListener>
</isd:service>
1.9 +1 -0 xml-soap/java/src/org/apache/soap/Constants.java
Index: Constants.java
===================================================================
RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/Constants.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- Constants.java 2000/09/01 02:36:49 1.8
+++ Constants.java 2000/10/17 12:03:40 1.9
@@ -115,6 +115,7 @@
public static String ELEM_FAULT_STRING = "faultstring";
public static String ELEM_FAULT_ACTOR = "faultactor";
public static String ELEM_DETAIL = "detail";
+ public static String ELEM_FAULT_DETAIL_ENTRY = "detailEntry";
// Qualified element names.
public static QName Q_ELEM_ENVELOPE =
1.5 +52 -7 xml-soap/java/src/org/apache/soap/Fault.java
Index: Fault.java
===================================================================
RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/Fault.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- Fault.java 2000/09/01 02:38:30 1.4
+++ Fault.java 2000/10/17 12:03:40 1.5
@@ -63,13 +63,15 @@
import org.apache.soap.util.*;
import org.apache.soap.util.xml.*;
import org.apache.soap.encoding.*;
-
+import org.apache.soap.rpc.Parameter;
/**
* A <code>Fault</code> object represents the contents and semantics
* of a <code><SOAP-ENV:Fault></code> element.
*
* @author Matthew J. Duftler (duftler@us.ibm.com)
* @author Sanjiva Weerawarana (sanjiva@watson.ibm.com)
+ * @author Eric M. Dashofy (edashofy@ics.uci.edu)
+ * @author Kevin J. Mitchell (kevin.mitchell@xmls.com)
*/
public class Fault
{
@@ -80,6 +82,13 @@
private Vector faultEntries = null;
private AttributeHandler attrHandler = new AttributeHandler();
+ public Fault() {}
+
+ public Fault(SOAPException _soapException) {
+ faultCode = _soapException.getFaultCode();
+ faultString = _soapException.getMessage();
+ }
+
public void setAttribute(QName attrQName, String value)
{
attrHandler.setAttribute(attrQName, value);
@@ -199,11 +208,24 @@
// Serialize the detail entries within the <detail> element.
for (Enumeration e = detailEntries.elements(); e.hasMoreElements();)
{
- Element detailEntryEl = (Element)e.nextElement();
-
- Utils.marshallNode(detailEntryEl, sink);
-
- sink.write(StringUtils.lineSeparator);
+ Object detailEntry = e.nextElement();
+
+ //if the detail entry is an Element, just write it
+ if (detailEntry instanceof Element) {
+ Element detailEntryEl = (Element)detailEntry;
+ Utils.marshallNode(detailEntryEl, sink);
+ sink.write(StringUtils.lineSeparator);
+ }
+
+ // if the detail entry is a Parameter, try to find a serializer, if there is an error, write nothing
+ else if (detailEntry instanceof Parameter) {
+ try {
+ Parameter detailEntryParameter = (Parameter)detailEntry;
+ xjmr.querySerializer(Parameter.class, inScopeEncStyle).marshall(inScopeEncStyle, Parameter.class, detailEntryParameter, Constants.ELEM_FAULT_DETAIL_ENTRY, sink, nsStack, xjmr);
+ sink.write(StringUtils.lineSeparator);
+ }
+ catch (IllegalArgumentException iae) {}
+ }
}
sink.write("</" + Constants.ELEM_DETAIL + '>' +
@@ -342,7 +364,30 @@
el != null;
el = DOMUtils.getNextSiblingElement(el))
{
- detailEntries.addElement(el);
+
+
+ //try to deserialize, if fails, just add element to list
+ try {
+
+ //find the declared encoding style
+ String declEncStyle = el.getAttributeNS(Constants.NS_URI_SOAP_ENV, Constants.ATTR_ENCODING_STYLE);
+
+ //determine the enc style to use based on this order: declared in element, inscope, SOAP encoding
+ String encStyle = declEncStyle != null ? declEncStyle : (inScopeEncStyle != null ? inScopeEncStyle : Constants.NS_URI_SOAP_ENC);
+
+ QName qn = new QName(el);
+
+ //Get a deserializer
+ Deserializer deser = xjmr.queryDeserializer( qn, encStyle);
+
+ Bean detailEntryBean = deser.unmarshall(encStyle, qn, el, xjmr);
+
+ detailEntries.addElement(detailEntryBean.value);
+ }
+ catch (Exception e) {
+ detailEntries.addElement(el);
+ }
+
}
fault.setDetailEntries(detailEntries);
1.3 +4 -0 xml-soap/java/src/org/apache/soap/SOAPException.java
Index: SOAPException.java
===================================================================
RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/SOAPException.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- SOAPException.java 2000/05/30 10:23:51 1.2
+++ SOAPException.java 2000/10/17 12:03:40 1.3
@@ -94,6 +94,10 @@
return targetException;
}
+ public Throwable getRootException() {
+ return targetException != null ? targetException : this;
+ }
+
public String getMessage () {
String superMsg = super.getMessage ();
String targetMsg = (targetException != null)
1.10 +56 -1 xml-soap/java/src/org/apache/soap/server/DeploymentDescriptor.java
Index: DeploymentDescriptor.java
===================================================================
RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/server/DeploymentDescriptor.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- DeploymentDescriptor.java 2000/09/01 03:52:52 1.9
+++ DeploymentDescriptor.java 2000/10/17 12:03:41 1.10
@@ -95,6 +95,8 @@
protected String[] methods;
protected TypeMapping[] mappings;
transient SOAPMappingRegistry cachedSMR;
+ protected String[] faultListener;
+ private transient SOAPFaultRouter fr;
private String defaultSMRClass = null;
/**
@@ -241,6 +243,29 @@
return cachedSMR;
}
+
+ public String[] getFaultListener() {return faultListener;}
+
+ public void setFaultListener(String[] _faultListener) {faultListener = _faultListener;}
+
+
+ public SOAPFaultRouter buildFaultRouter() {
+ if (fr != null) return fr;
+
+ fr = new SOAPFaultRouter();
+
+ if (faultListener == null) return fr;
+
+
+ SOAPFaultListener[] lis = new SOAPFaultListener[faultListener.length];
+ try {
+ for (int i = 0; i< faultListener.length; lis[i] = (SOAPFaultListener)Class.forName(faultListener[i]).newInstance(), i++);
+ }
+ catch (Exception e) {}
+
+ fr.setFaultListener(lis);
+ return fr;
+ }
/**
* Write out the deployment descriptor according to the
* the deployment descriptor DTD.
@@ -282,6 +307,14 @@
}
pw.println (" </isd:provider>");
+ if (faultListener != null) {
+ for (int i = 0; i < faultListener.length; i++) {
+ pw.println("<isd:faultListener>");
+ pw.println(faultListener[i]);
+ pw.println("</isd:faultListener>");
+ }
+ }
+
if (mappings != null) {
pw.println (" <isd:mappings");
if (defaultSMRClass != null) {
@@ -440,6 +473,24 @@
}
dd.setMethods (methods);
+
+ //read the fault listeners
+ nl = root.getElementsByTagNameNS (Constants.NS_URI_XML_SOAP_DEPLOYMENT,
+ "faultListener");
+ String[] lis = new String[nl.getLength()];
+
+ try {
+ for (int i = 0; i < nl.getLength(); i++) {
+ Class.forName(DOMUtils.getChildCharacterData((Element)nl.item(i))).newInstance();
+ lis[i] = DOMUtils.getChildCharacterData((Element)nl.item(i));
+ }
+ }
+ catch (Exception ex) {
+ throw new IllegalArgumentException(ex.getMessage());
+ }
+
+ dd.setFaultListener(lis);
+
// read the type mappings
nl = root.getElementsByTagNameNS (Constants.NS_URI_XML_SOAP_DEPLOYMENT,
"mappings");
@@ -506,7 +557,11 @@
body = "script='" + scriptFilenameOrString + "', ";
body += "language='" + scriptLanguage + "', ";
}
- return header + body + "methods='" + methodsStrbuf + "', " +
+
+ StringBuffer lis = new StringBuffer("[");
+ if (faultListener != null) for (int i = 0; i < faultListener.length; lis.append(faultListener[i]), lis.append(" "), i++);
+ lis.append("]");
+ return header + body + "methods='" + methodsStrbuf + "', " + "faultListener='" + lis + "', " +
"mappings='" + mappings + "]";
}
1.3 +26 -30 xml-soap/java/src/org/apache/soap/server/http/MessageRouterServlet.java
Index: MessageRouterServlet.java
===================================================================
RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/server/http/MessageRouterServlet.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- MessageRouterServlet.java 2000/09/01 03:52:56 1.2
+++ MessageRouterServlet.java 2000/10/17 12:03:41 1.3
@@ -76,23 +76,27 @@
* @author Sanjiva Weerawarana <sa...@watson.ibm.com>
*/
public class MessageRouterServlet extends HttpServlet {
+
public void doGet (HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {
PrintWriter out = res.getWriter ();
- out.println ("<body><h1>SOAP Message Router</h1>");
+ res.setContentType("text/html");
+ out.println("<html><head><title>SOAP RPC Router</title></head>");
+ out.println ("<body><h1>SOAP RPC Router</h1>");
out.println ("<p>Sorry, I don't speak via HTTP GET- you have to use");
- out.println ("HTTP POST to talk to me.</p></body>");
+ out.println ("HTTP POST to talk to me.</p></body></html>");
}
- public void doPost (HttpServletRequest req, HttpServletResponse res)
- throws ServletException, IOException {
- ServletConfig config = getServletConfig ();
+ public void doPost (HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
+
+ ServletConfig config = getServletConfig();
ServletContext context = config.getServletContext ();
HttpSession session = req.getSession ();
ServiceManager serviceManager =
ServerHTTPUtils.getServiceManagerFromContext (context);
int status;
+ DeploymentDescriptor dd = null;
// create a writer to direct stuff to so that we can set the
// content length
@@ -101,9 +105,6 @@
true) ;
try {
- System.err.println (">>(" + new Date() +
- ") Processing SOAP Message request...");
-
// get the envelope
Envelope msgEnv = ServerHTTPUtils.readEnvelopeFromRequest (req, res);
@@ -118,7 +119,7 @@
String messageName = e.getLocalName ();
// is this a valid message?
- DeploymentDescriptor dd = serviceManager.query (targetID);
+ dd = serviceManager.query (targetID);
if (!MessageRouter.validMessage (dd, messageName)) {
throw new SOAPException (Constants.FAULT_CODE_SERVER,
"Message '" + messageName + "' unknown to " +
@@ -147,29 +148,24 @@
// idea is to do a SOAP fault for everything that goes out so
// that if the recepient is expecting to read some XML they'll
// get it. If not, it doesn't hurt.
- String faultCode = Constants.FAULT_CODE_SERVER + ".Exception:" +
- t.getClass().getName ();
- String faultString = t.getMessage ();
- Throwable pt = t;
- status = res.SC_INTERNAL_SERVER_ERROR;
- if (t instanceof SOAPException) {
- SOAPException e = (SOAPException) t;
- faultCode = e.getFaultCode ();
- if (faultCode.startsWith (Constants.FAULT_CODE_CLIENT)) {
- status = ServerConstants.SC_BAD_REQUEST;
- }
- Throwable tt = e.getTargetException ();
- pt = (tt == null) ? e : tt;
- }
- // build the fault envelope
- Fault fault = new Fault ();
- fault.setFaultCode (faultCode);
- fault.setFaultString (faultString);
+ SOAPException e = null;
+ if (t instanceof SOAPException) e = (SOAPException) t; else e = new SOAPException(Constants.FAULT_CODE_SERVER + ".Exception:", "", t);
+
+ Fault fault = new Fault (e);
fault.setFaultActorURI (req.getRequestURI ());
- Vector det = Utils.buildFaultDetailsFromThrowable (pt);
- fault.setDetailEntries (det);
- Response resp = new Response (null, null, fault, null, null, null);
+ dd.buildFaultRouter().notifyListeners(fault, e);
+
+ //determine the correct return HTTP status
+ if (fault.getFaultCode().startsWith (Constants.FAULT_CODE_CLIENT)) {
+ status = ServerConstants.SC_BAD_REQUEST;
+ }
+ else {
+ status = res.SC_INTERNAL_SERVER_ERROR;
+ }
+
+ Response resp = new Response (null, null, fault, null, null, Constants.NS_URI_SOAP_ENC);
+
Envelope respEnvelope = resp.buildEnvelope ();
respEnvelope.marshall (out, new SOAPMappingRegistry ());
out.close ();
1.6 +31 -29 xml-soap/java/src/org/apache/soap/server/http/RPCRouterServlet.java
Index: RPCRouterServlet.java
===================================================================
RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/server/http/RPCRouterServlet.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- RPCRouterServlet.java 2000/09/01 03:52:57 1.5
+++ RPCRouterServlet.java 2000/10/17 12:03:41 1.6
@@ -78,32 +78,38 @@
* @author Sanjiva Weerawarana <sa...@watson.ibm.com>
* @author Matthew J. Duftler <du...@us.ibm.com>
* @author Steven McDowall <sj...@aptest.com>
+ * @author Eric M. Dashofy (edashofy@ics.uci.edu)
+ * @author Kevin J. Mitchell (kevin.mitchell@xmls.com)
*/
public class RPCRouterServlet extends HttpServlet {
+
public void doGet (HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {
PrintWriter out = res.getWriter ();
-
+
+ res.setContentType("text/html");
+ out.println("<html><head><title>SOAP RPC Router</title></head>");
out.println ("<body><h1>SOAP RPC Router</h1>");
out.println ("<p>Sorry, I don't speak via HTTP GET- you have to use");
- out.println ("HTTP POST to talk to me.</p></body>");
+ out.println ("HTTP POST to talk to me.</p></body></html>");
}
public void doPost (HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {
- ServletConfig config = getServletConfig ();
+
+ ServletConfig config = getServletConfig();
ServletContext context = config.getServletContext ();
+
HttpSession session = req.getSession ();
ServiceManager serviceManager =
ServerHTTPUtils.getServiceManagerFromContext (context);
-
Call call = null;
Response resp = null;
String targetID = null;
+ int status = res.SC_OK;
+ DeploymentDescriptor dd = null;
try {
- System.err.println (">>(" + new Date() +
- ") Processing SOAP RPC request...");
// extract the call
try {
@@ -121,7 +127,7 @@
// get the deployment descriptor for this service (will except if
// not known)
- DeploymentDescriptor dd = serviceManager.query (targetID);
+ dd = serviceManager.query (targetID);
// call on a valid method name?
if (!RPCRouter.validCall (dd, call)) {
@@ -137,35 +143,30 @@
context);
// invoke the method on the target object
resp = RPCRouter.invoke (dd, call, targetObject);
-
} catch (Throwable t) {
// note that we catch runtime errors too with the above .. the
// idea is to do a SOAP fault for everything that goes out so
// that if the recepient is expecting to read some XML they'll
// get it. If not, it doesn't hurt.
- String faultCode = Constants.FAULT_CODE_SERVER + ".Exception:" +
- t.getClass().getName ();
- String faultString = t.getMessage ();
- Throwable pt = t;
- int status = res.SC_INTERNAL_SERVER_ERROR;
- if (t instanceof SOAPException) {
- SOAPException e = (SOAPException) t;
- faultCode = e.getFaultCode ();
- if (faultCode.startsWith (Constants.FAULT_CODE_CLIENT)) {
- status = ServerConstants.SC_BAD_REQUEST;
- }
- Throwable tt = e.getTargetException ();
- pt = (tt == null) ? e : tt;
- }
+ SOAPException e = null;
+ if (t instanceof SOAPException) e = (SOAPException) t; else e = new SOAPException(Constants.FAULT_CODE_SERVER + ".Exception:", "", t);
- // build the fault envelope
- Fault fault = new Fault ();
- fault.setFaultCode (faultCode);
- fault.setFaultString (faultString);
+ Fault fault = new Fault (e);
fault.setFaultActorURI (req.getRequestURI ());
- Vector det = Utils.buildFaultDetailsFromThrowable (pt);
- fault.setDetailEntries (det);
- resp = new Response (null, null, fault, null, null, null);
+ dd.buildFaultRouter().notifyListeners(fault, e);
+
+ //determine the correct return HTTP status
+ if (fault.getFaultCode().startsWith (Constants.FAULT_CODE_CLIENT)) {
+ status = ServerConstants.SC_BAD_REQUEST;
+ }
+ else {
+ status = res.SC_INTERNAL_SERVER_ERROR;
+ }
+
+ String respEncStyle = call.getEncodingStyleURI();
+ if(respEncStyle == null) respEncStyle = Constants.NS_URI_SOAP_ENC;
+
+ resp = new Response (null, null, fault, null, null, respEncStyle);
}
// create a writer to direct stuff to so that we can set the
@@ -192,6 +193,7 @@
// ship the stuff out
res.setContentType (Constants.HEADERVAL_CONTENT_TYPE_UTF8);
res.setContentLength (bytes.size ()) ;
+ res.setStatus(status);
bytes.writeTo (res.getOutputStream ()) ;
}
}
1.3 +61 -4 xml-soap/java/src/org/apache/soap/server/http/ServerHTTPUtils.java
Index: ServerHTTPUtils.java
===================================================================
RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/server/http/ServerHTTPUtils.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ServerHTTPUtils.java 2000/09/01 03:52:57 1.2
+++ ServerHTTPUtils.java 2000/10/17 12:03:41 1.3
@@ -1,3 +1,60 @@
+/*
+ * The Apache Software License, Version 1.1
+ *
+ *
+ * Copyright (c) 2000 The Apache Software Foundation. All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ * if any, must include the following acknowledgment:
+ * "This product includes software developed by the
+ * Apache Software Foundation (http://www.apache.org/)."
+ * Alternately, this acknowledgment may appear in the software itself,
+ * if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "SOAP" and "Apache Software Foundation" must
+ * not be used to endorse or promote products derived from this
+ * software without prior written permission. For written
+ * permission, please contact apache@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache",
+ * nor may "Apache" appear in their name, without prior written
+ * permission of the Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation and was
+ * originally based on software copyright (c) 2000, International
+ * Business Machines, Inc., http://www.apache.org. For more
+ * information on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
package org.apache.soap.server.http;
import java.io.*;
@@ -16,7 +73,7 @@
*
* @author Sanjiva Weerawarana
*/
-class ServerHTTPUtils {
+public class ServerHTTPUtils {
private static final String SERVICE_MANAGER_ID = "serviceManager";
private static final String SCRIPT_CLASS = "com.ibm.bsf.BSFManager";
private static final String SCRIPT_INVOKER =
@@ -29,7 +86,7 @@
* per JVM. In that case we'll have to use an external database
* to store this webapp-global attribute.
*/
- static ServiceManager getServiceManagerFromContext (ServletContext context) {
+ public static ServiceManager getServiceManagerFromContext (ServletContext context) {
Object o;
synchronized (context) {
o = context.getAttribute (SERVICE_MANAGER_ID);
@@ -53,7 +110,7 @@
* @exception IOException if something fails while sending an
* error response
*/
- static Envelope readEnvelopeFromRequest (HttpServletRequest req,
+ public static Envelope readEnvelopeFromRequest (HttpServletRequest req,
HttpServletResponse res)
throws SOAPException, IOException {
String contentType = req.getContentType ();
@@ -99,7 +156,7 @@
* given ID. Depending on the deployment information of the
* service, the object's lifecycle is also managed here.
*/
- static Object getTargetObject (ServiceManager serviceManager,
+ public static Object getTargetObject (ServiceManager serviceManager,
DeploymentDescriptor dd,
String targetID,
HttpServlet thisServlet,
1.3 +8 -0 xml-soap/java/webapps/soap/WEB-INF/web.xml
Index: web.xml
===================================================================
RCS file: /home/cvs/xml-soap/java/webapps/soap/WEB-INF/web.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- web.xml 2000/09/01 02:46:49 1.2
+++ web.xml 2000/10/17 12:03:42 1.3
@@ -12,6 +12,10 @@
<servlet-class>
org.apache.soap.server.http.RPCRouterServlet
</servlet-class>
+ <init-param>
+ <param-name>faultListener</param-name>
+ <param-value>org.apache.soap.server.DOMFaultListener</param-value>
+ </init-param>
</servlet>
<servlet>
<servlet-name>
@@ -20,5 +24,9 @@
<servlet-class>
org.apache.soap.server.http.MessageRouterServlet
</servlet-class>
+ <init-param>
+ <param-name>faultListener</param-name>
+ <param-value>org.apache.soap.server.DOMFaultListener</param-value>
+ </init-param>
</servlet>
</web-app>