|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectsoaprest.ResponseUtility
@Copyright public class ResponseUtility
Utility for constructing the web service responses, including both normal return values and exceptions. The exceptions are fault exceptions. A SOAP client will handle these by converting them to exceptions. A REST client has no such capability. One can either return a generic HTTP code with no information about what failed, or one can return the body of a SOAP fault exception.
| Field Summary | |
|---|---|
private javax.xml.parsers.DocumentBuilder |
builder
The DOM document builder. |
private javax.xml.bind.JAXBContext |
context
JAXB Serialization Context. |
private InvocationUtility |
invoker
The invocation utility. |
| Constructor Summary | |
|---|---|
ResponseUtility(java.lang.String packages,
InvocationUtility invoker)
Construct a response utility. |
|
| Method Summary | |
|---|---|
void |
response(org.w3c.dom.Document doc,
javax.servlet.http.HttpServletResponse res)
DOM document formatting. |
void |
response(org.w3c.dom.Document doc,
java.io.OutputStream out)
DOM document formatting. |
javax.xml.transform.Source |
response(SoapRestException exception)
Fault formatting. |
void |
response(SoapRestException exception,
javax.servlet.http.HttpServletResponse res)
Fault formatting. |
void |
response(SoapRestException exception,
java.io.OutputStream out)
Fault formatting. |
javax.xml.transform.Source |
response(SoapRestObject soaprestObject)
Object response formatting to a source. |
void |
response(SoapRestObject soaprestObject,
javax.servlet.http.HttpServletResponse res)
Object response formatting. |
void |
response(SoapRestObject soaprestObject,
java.io.OutputStream out)
Object response formatting. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private javax.xml.bind.JAXBContext context
private javax.xml.parsers.DocumentBuilder builder
private InvocationUtility invoker
| Constructor Detail |
|---|
public ResponseUtility(java.lang.String packages,
InvocationUtility invoker)
throws java.lang.Exception
packages - The colon-delimited list of packages with serializable
classes.invoker - The invocation utility.
java.lang.Exception - if an object factory is not available for a specified
package.| Method Detail |
|---|
public void response(SoapRestObject soaprestObject,
javax.servlet.http.HttpServletResponse res)
throws SoapRestException
soaprestObject - The value of the response element. While the soaprestObject
itself is never null, it can contain a null object.res - The HttpServletResponse object that contains the response to the client.
SoapRestException - if a transformation error occurred.
public void response(SoapRestObject soaprestObject,
java.io.OutputStream out)
throws SoapRestException
soaprestObject - The value of the response element. While the soaprestObject
itself is never null, it can contain a null object.out - The output stream to which the object is to be written.
SoapRestException - if a transformation error occurred.
public javax.xml.transform.Source response(SoapRestObject soaprestObject)
throws SoapRestException
soaprestObject - The value of the response element. While the
soaprestObject itself is never null, it can contain a null object.
SoapRestException - if an object factory is not available for a specified
package.
public void response(SoapRestException exception,
javax.servlet.http.HttpServletResponse res)
throws SoapRestException
exception - The exception to be formatted.res - The HttpServletResponse object that contains the response to the client.
SoapRestException - if the transformation failed.
public void response(SoapRestException exception,
java.io.OutputStream out)
throws SoapRestException
exception - The exception to be formatted.out - The output stream to which the exception is to be written.
SoapRestException - if the transformation failed.public javax.xml.transform.Source response(SoapRestException exception)
exception - The exception to be formatted.
public void response(org.w3c.dom.Document doc,
javax.servlet.http.HttpServletResponse res)
doc - The document.res - The HttpServletResponse object that contains the response to the client.
public void response(org.w3c.dom.Document doc,
java.io.OutputStream out)
doc - The document.out - The output stream to which the object is to be written.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||