public void readBody(ActionResponseMessage responseMsg, ActionInvocation actionInvocation) throws UnsupportedDataException { try { super.readBody(responseMsg, actionInvocation); } catch (UnsupportedDataException ex) { // Can't recover from this if (!responseMsg.isBodyNonEmptyString()) throw ex; log.warning("Trying to recover from invalid SOAP XML response: " + ex); String body = getMessageBody(responseMsg); // TODO: UPNP VIOLATION: TwonkyMobile doesn't properly encode '&' String fixedBody = XmlPullParserUtils.fixXMLEntities(body); // TODO: UPNP VIOLATION: YAMAHA NP-S2000 does not terminate XML with </s:Envelope> // (at least for action GetPositionInfo) if (fixedBody.endsWith("</s:Envelop")) { fixedBody += "e>"; } try { // Try again, if this fails, we are done... responseMsg.setBody(fixedBody); super.readBody(responseMsg, actionInvocation); } catch (UnsupportedDataException ex2) { handleInvalidMessage(actionInvocation, ex, ex2); } } }
public void readBody(IncomingEventRequestMessage requestMessage) throws UnsupportedDataException { try { super.readBody(requestMessage); } catch (UnsupportedDataException ex) { // Can't recover from this if (!requestMessage.isBodyNonEmptyString()) throw ex; log.warning("Trying to recover from invalid GENA XML event: " + ex); // Some properties may have been read at this point, so reset the list requestMessage.getStateVariableValues().clear(); String body = getMessageBody(requestMessage); String fixedBody = fixXMLEncodedLastChange( XmlPullParserUtils.fixXMLEntities(body) ); try { // Try again, if this fails, we are done... requestMessage.setBody(fixedBody); super.readBody(requestMessage); } catch (UnsupportedDataException ex2) { // Check if some properties were read if (requestMessage.getStateVariableValues().isEmpty()) { // Throw the initial exception containing unmodified XML throw ex; } log.warning("Partial read of GENA event properties (probably due to truncated XML)"); } } }
public void readBody(ActionRequestMessage requestMessage, ActionInvocation actionInvocation) throws UnsupportedDataException { try { super.readBody(requestMessage, actionInvocation); } catch (UnsupportedDataException ex) { // Can't recover from this if (!requestMessage.isBodyNonEmptyString()) throw ex; log.warning("Trying to recover from invalid SOAP XML request: " + ex); String body = getMessageBody(requestMessage); // TODO: UPNP VIOLATION: TwonkyMobile sends unencoded '&' in SetAVTransportURI action calls: // <CurrentURI>http://192.168.1.14:56923/content/12a470d854dbc6887e4103e3140783fd.wav?profile_id=0&convert=wav</CurrentURI> String fixedBody = XmlPullParserUtils.fixXMLEntities(body); try { // Try again, if this fails, we are done... requestMessage.setBody(fixedBody); super.readBody(requestMessage, actionInvocation); } catch (UnsupportedDataException ex2) { handleInvalidMessage(actionInvocation, ex, ex2); } } }
fixedXml = XmlPullParserUtils.fixXMLEntities(descriptorXml); if(!fixedXml.equals(descriptorXml)) { try {
public void readBody(ActionResponseMessage responseMsg, ActionInvocation actionInvocation) throws UnsupportedDataException { try { super.readBody(responseMsg, actionInvocation); } catch (UnsupportedDataException ex) { // Can't recover from this if (!responseMsg.isBodyNonEmptyString()) throw ex; log.warning("Trying to recover from invalid SOAP XML response: " + ex); String body = getMessageBody(responseMsg); // TODO: UPNP VIOLATION: TwonkyMobile doesn't properly encode '&' String fixedBody = XmlPullParserUtils.fixXMLEntities(body); // TODO: UPNP VIOLATION: YAMAHA NP-S2000 does not terminate XML with </s:Envelope> // (at least for action GetPositionInfo) if (fixedBody.endsWith("</s:Envelop")) { fixedBody += "e>"; } try { // Try again, if this fails, we are done... responseMsg.setBody(fixedBody); super.readBody(responseMsg, actionInvocation); } catch (UnsupportedDataException ex2) { handleInvalidMessage(actionInvocation, ex, ex2); } } }
public void readBody(IncomingEventRequestMessage requestMessage) throws UnsupportedDataException { try { super.readBody(requestMessage); } catch (UnsupportedDataException ex) { // Can't recover from this if (!requestMessage.isBodyNonEmptyString()) throw ex; log.warning("Trying to recover from invalid GENA XML event: " + ex); // Some properties may have been read at this point, so reset the list requestMessage.getStateVariableValues().clear(); String body = getMessageBody(requestMessage); String fixedBody = fixXMLEncodedLastChange( XmlPullParserUtils.fixXMLEntities(body) ); try { // Try again, if this fails, we are done... requestMessage.setBody(fixedBody); super.readBody(requestMessage); } catch (UnsupportedDataException ex2) { // Check if some properties were read if (requestMessage.getStateVariableValues().isEmpty()) { // Throw the initial exception containing unmodified XML throw ex; } log.warning("Partial read of GENA event properties (probably due to truncated XML)"); } } }
fixedXml = XmlPullParserUtils.fixXMLEntities(descriptorXml); if(!fixedXml.equals(descriptorXml)) { try {
public void readBody(ActionRequestMessage requestMessage, ActionInvocation actionInvocation) throws UnsupportedDataException { try { super.readBody(requestMessage, actionInvocation); } catch (UnsupportedDataException ex) { // Can't recover from this if (!requestMessage.isBodyNonEmptyString()) throw ex; log.warning("Trying to recover from invalid SOAP XML request: " + ex); String body = getMessageBody(requestMessage); // TODO: UPNP VIOLATION: TwonkyMobile sends unencoded '&' in SetAVTransportURI action calls: // <CurrentURI>http://192.168.1.14:56923/content/12a470d854dbc6887e4103e3140783fd.wav?profile_id=0&convert=wav</CurrentURI> String fixedBody = XmlPullParserUtils.fixXMLEntities(body); try { // Try again, if this fails, we are done... requestMessage.setBody(fixedBody); super.readBody(requestMessage, actionInvocation); } catch (UnsupportedDataException ex2) { handleInvalidMessage(actionInvocation, ex, ex2); } } }
public void readBody(IncomingEventRequestMessage requestMessage) throws UnsupportedDataException { try { super.readBody(requestMessage); } catch (UnsupportedDataException ex) { // Can't recover from this if (!requestMessage.isBodyNonEmptyString()) throw ex; log.warning("Trying to recover from invalid GENA XML event: " + ex); // Some properties may have been read at this point, so reset the list requestMessage.getStateVariableValues().clear(); String body = getMessageBody(requestMessage); String fixedBody = fixXMLEncodedLastChange( XmlPullParserUtils.fixXMLEntities(body) ); try { // Try again, if this fails, we are done... requestMessage.setBody(fixedBody); super.readBody(requestMessage); } catch (UnsupportedDataException ex2) { // Check if some properties were read if (requestMessage.getStateVariableValues().isEmpty()) { // Throw the initial exception containing unmodified XML throw ex; } log.warning("Partial read of GENA event properties (probably due to truncated XML)"); } } }
public void readBody(ActionResponseMessage responseMsg, ActionInvocation actionInvocation) throws UnsupportedDataException { try { super.readBody(responseMsg, actionInvocation); } catch (UnsupportedDataException ex) { // Can't recover from this if (!responseMsg.isBodyNonEmptyString()) throw ex; log.warning("Trying to recover from invalid SOAP XML response: " + ex); String body = getMessageBody(responseMsg); // TODO: UPNP VIOLATION: TwonkyMobile doesn't properly encode '&' String fixedBody = XmlPullParserUtils.fixXMLEntities(body); // TODO: UPNP VIOLATION: YAMAHA NP-S2000 does not terminate XML with </s:Envelope> // (at least for action GetPositionInfo) if (fixedBody.endsWith("</s:Envelop")) { fixedBody += "e>"; } try { // Try again, if this fails, we are done... responseMsg.setBody(fixedBody); super.readBody(responseMsg, actionInvocation); } catch (UnsupportedDataException ex2) { handleInvalidMessage(actionInvocation, ex, ex2); } } }
fixedXml = XmlPullParserUtils.fixXMLEntities(descriptorXml); if(!fixedXml.equals(descriptorXml)) { try {
public void readBody(ActionRequestMessage requestMessage, ActionInvocation actionInvocation) throws UnsupportedDataException { try { super.readBody(requestMessage, actionInvocation); } catch (UnsupportedDataException ex) { // Can't recover from this if (!requestMessage.isBodyNonEmptyString()) throw ex; log.warning("Trying to recover from invalid SOAP XML request: " + ex); String body = getMessageBody(requestMessage); // TODO: UPNP VIOLATION: TwonkyMobile sends unencoded '&' in SetAVTransportURI action calls: // <CurrentURI>http://192.168.1.14:56923/content/12a470d854dbc6887e4103e3140783fd.wav?profile_id=0&convert=wav</CurrentURI> String fixedBody = XmlPullParserUtils.fixXMLEntities(body); try { // Try again, if this fails, we are done... requestMessage.setBody(fixedBody); super.readBody(requestMessage, actionInvocation); } catch (UnsupportedDataException ex2) { handleInvalidMessage(actionInvocation, ex, ex2); } } }