com.sssw.jbroker.web.portable
Class DOMSkeleton
java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
com.sssw.jbroker.web.portable.SAAJSkeleton
com.sssw.jbroker.web.portable.DOMSkeleton
- All Implemented Interfaces:
- Serializable, Servlet, ServletConfig
- public abstract class DOMSkeleton
- extends SAAJSkeleton
The DOMSkeleton
is a special, generic skeleton, which always treats
parameters as un-typed. The XML instance on the wire will not be bound to a Java
object using the type mapper; instead, the arguments are passed down as
Element
objects. Classes that extend the DOMSkeleton
must implement one of the
abstract invoke
methods.
The DOMSkeleton
typically requires configuration to work
properly. The following fragmet from the deployment descriptor shows the
configuration properties available:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
<web-app>
<servlet>
<servlet-name>MyDOMService</servlet-name>
<servlet-class>com.sssw.jbroker.web.portable.DOMSkeleton</servlet-class>
<init-param>
<param-name>isDocument</param-name>
<param-value>TRUE</param-value>
<param-name>portTypeQName</param-name>
<param-value>http://www.example.com:foo</param-value>
<param-name>schemaURI</param-name>
<param-value>http://www.w3.org/2001/XMLSchema</param-value>
<param-name>encodingURI</param-name>
<param-value>http://schemas.xmlsoap.org/soap/encoding/</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>MyDOMService</servlet-name>
<url-pattern>/service/xyz</url-pattern>
</servlet-mapping>
These properties can also be set globally in the servlet context if all
servlets in an application share the same settings. If any of these values
are not present, they will default to the following:
isDocument | FALSE |
schemaURI | http://www.w3.org/2001/XMLSchema |
encodingURI | soap |
The servlet initialization will fail if the portTypeQName
parameter is missing.
- Since:
- jBroker Web 2.1
- See Also:
- Serialized Form
DOMSkeleton
public DOMSkeleton()
invoke
public SOAPMessage invoke(SOAPMessage message)
- Description copied from class:
SAAJSkeleton
- Abstract invocation method, which must be provided by the sub class.
- Specified by:
invoke
in class SAAJSkeleton
- Parameters:
message
- the incoming SOAPMessage
object
- Returns:
- must return a
SOAPMessage
that will be written
into the servlet response.
init
public void init(ServletConfig config)
throws ServletException
- Initialize this
DOMSkeleton
. If a base class also implements
the init
method, it must call super.init(config)
to ensure proper servlet initialization.
- Parameters:
config
- the servlet configuration
- Throws:
ServletException
- if the portTypeQName
parameter is
missing from the servlet configuration
invoke
public Element[] invoke(Map headers,
Element[] inParams)
throws ApplicationException
- Implementation for this method should be provided by the sub class.
This method can only be used when a SOAP message has no header elements
and attachments parts. If a SOAP message has headers and attachments
the
DOMMessage invoke(DOMMessage)
method should be used.
- Parameters:
headers
- a map with two header values:
-
javax.xml.rpc.soap.http.soapaction.uri
- the value
of the soapAction
associated with this request (if any)
-
jbroker.web.operation.name
- the name of the operation
if this servlet is RPC style.
inParams
- a array of org.w3c.dom.Element
objects that
correspond to the input message parts inside the SOAP body.
- Returns:
- an array of
org.w3c.dom.Element
objects that
correspond to the output message parts of the SOAP body.
- Throws:
ApplicationException
- if a SOAP fault occured. The detail of
the SOAP fault can be set as an org.w3c.dom.Element
object
invoke
public DOMMessage invoke(DOMMessage domMessage)
throws ApplicationException
- Though not abstract, this method can be implemented by subclass to get
access to attachments and header parameters. The default implementation
of the method invokes the
invoke(Map, Element[])
with the
body params.
- Returns:
- DOMMessage for the SOAP response message.
- Throws:
ApplicationException
- if a SOAP fault occured. The detail of
the SOAP fault can be set as an org.w3c.dom.Element
object
exteNd is a registered trademark of Novell, Inc.
Copyright 1998-2003 Novell, Inc. All Rights Reserved.