@Alternative public class RecoveringSOAPActionProcessorImpl extends PullSOAPActionProcessorImpl
This processor extends PullSOAPActionProcessorImpl
, it will always
first try to read messages regularly with the superclass' methods before
trying to recover from a failure.
When the superclass can't read the message, this processor will try to recover from broken XML by for example, detecting wrongly encoded XML entities, and working around other vendor-specific bugs caused by incompatible UPnP stacks in the wild.
Additionally any UnsupportedDataException
thrown while reading an
XML message will be passed on to the
handleInvalidMessage(org.fourthline.cling.model.action.ActionInvocation, org.fourthline.cling.model.UnsupportedDataException, org.fourthline.cling.model.UnsupportedDataException)
method for you to handle. The default implementation will simply throw the
original exception from the first processing attempt.
Constructor and Description |
---|
RecoveringSOAPActionProcessorImpl() |
Modifier and Type | Method and Description |
---|---|
protected void |
handleInvalidMessage(ActionInvocation actionInvocation,
UnsupportedDataException originalException,
UnsupportedDataException recoveringException)
Handle processing errors while reading of XML messages.
|
void |
readBody(ActionRequestMessage requestMessage,
ActionInvocation actionInvocation)
Converts SOAP XML content of the request message and sets input argument values on the given invocation.
|
void |
readBody(ActionResponseMessage responseMsg,
ActionInvocation actionInvocation)
Converts SOAP XML content of the response message and sets output argument values on the given invocation.
|
findActionArgumentValue, getMatchingNodes, readActionInputArguments, readActionOutputArguments, readArgumentValues, readBodyElement, readBodyRequest, readBodyResponse, readFaultElement
createDocumentBuilderFactory, createValue, error, fatalError, findActionArgumentNode, getMatchingNodes, getMessageBody, getUnprefixedNodeName, readActionInputArguments, readActionOutputArguments, readActionRequestElement, readActionResponseElement, readArgumentValues, readBodyElement, readBodyFailure, readBodyRequest, readBodyResponse, readFaultElement, toString, warning, writeActionInputArguments, writeActionOutputArguments, writeActionRequestElement, writeActionResponseElement, writeBody, writeBody, writeBodyElement, writeBodyFailure, writeBodyRequest, writeBodyResponse, writeFaultElement
public void readBody(ActionRequestMessage requestMessage, ActionInvocation actionInvocation) throws UnsupportedDataException
SOAPActionProcessor
readBody
in interface SOAPActionProcessor
readBody
in class PullSOAPActionProcessorImpl
requestMessage
- The request message from which SOAP content is read.actionInvocation
- The action invocation on which input argument values are set.UnsupportedDataException
public void readBody(ActionResponseMessage responseMsg, ActionInvocation actionInvocation) throws UnsupportedDataException
SOAPActionProcessor
readBody
in interface SOAPActionProcessor
readBody
in class PullSOAPActionProcessorImpl
responseMsg
- The response message from which SOAP content is read.actionInvocation
- The action invocation on which output argument values are set.UnsupportedDataException
protected void handleInvalidMessage(ActionInvocation actionInvocation, UnsupportedDataException originalException, UnsupportedDataException recoveringException) throws UnsupportedDataException
Typically you want to log this problem or create an error report, and in any
case, throw an UnsupportedDataException
to notify the caller of the
processor of this failure.
You can access the invalid XML with
UnsupportedDataException.getData()
.
originalException
- The original exception throw by the first parsing attemptrecoveringException
- The exception thrown after trying to fix the XML.UnsupportedDataException
Copyright © 2016 4th Line GmbH, Switzerland. All rights reserved.