public class ResponseObjectCreator
extends java.lang.Object
Constructor and Description |
---|
ResponseObjectCreator() |
Modifier and Type | Method and Description |
---|---|
private com.fasterxml.jackson.databind.node.ObjectNode |
convertToJson(org.w3c.dom.Element xml)
Converts a XML element into a JSON ObjectNode.
|
byte[] |
createErrorResponse(int code,
java.lang.String message,
java.lang.String[] data,
java.lang.Object idProperty)
Writes a JSON-RPC 2.0 response object when a RPC call encounters an error.
|
byte[] |
createNormalResponse(org.w3c.dom.Element header,
org.w3c.dom.Element body,
java.lang.Object idProperty)
Writes a JSON-RPC 2.0 response object WITH HEADER when everything goes okay.
|
byte[] |
createNormalResponse(org.w3c.dom.Element body,
java.lang.Object idProperty)
Writes a JSON-RPC 2.0 response object WITHOUT HEADER when everything goes okay.
|
public byte[] createNormalResponse(org.w3c.dom.Element body, java.lang.Object idProperty) throws com.fasterxml.jackson.core.JsonParseException, com.fasterxml.jackson.databind.JsonMappingException, javax.xml.stream.XMLStreamException, javax.xml.stream.FactoryConfigurationError, java.io.IOException
body
- The SOAP Body elementidProperty
- JSON-RPC idjava.io.IOException
javax.xml.stream.FactoryConfigurationError
javax.xml.stream.XMLStreamException
com.fasterxml.jackson.databind.JsonMappingException
com.fasterxml.jackson.core.JsonParseException
public byte[] createNormalResponse(org.w3c.dom.Element header, org.w3c.dom.Element body, java.lang.Object idProperty) throws com.fasterxml.jackson.core.JsonParseException, com.fasterxml.jackson.databind.JsonMappingException, javax.xml.stream.XMLStreamException, javax.xml.stream.FactoryConfigurationError, java.io.IOException
header
- The SOAP Header elementbody
- The SOAP Body elementidProperty
- JSON-RPC idjava.io.IOException
javax.xml.stream.FactoryConfigurationError
javax.xml.stream.XMLStreamException
com.fasterxml.jackson.databind.JsonMappingException
com.fasterxml.jackson.core.JsonParseException
public byte[] createErrorResponse(int code, java.lang.String message, java.lang.String[] data, java.lang.Object idProperty) throws com.fasterxml.jackson.core.JsonProcessingException
code
- Error codemessage
- Error messagedata
- Details about error (if any)idProperty
- JSON-RPC idcom.fasterxml.jackson.core.JsonProcessingException
private com.fasterxml.jackson.databind.node.ObjectNode convertToJson(org.w3c.dom.Element xml) throws javax.xml.stream.XMLStreamException, javax.xml.stream.FactoryConfigurationError, com.fasterxml.jackson.core.JsonParseException, com.fasterxml.jackson.databind.JsonMappingException, java.io.IOException
xml
- XML element to be convertedjavax.xml.stream.FactoryConfigurationError
javax.xml.stream.XMLStreamException
java.io.IOException
com.fasterxml.jackson.databind.JsonMappingException
com.fasterxml.jackson.core.JsonParseException