public Object read(InputStream inputStream, Map<String, Object> metadata, Map<String, Object> headers) throws IOException { if (log.isTraceEnabled()) log.trace("Read input stream with metadata=" + metadata); try { SOAPMessage soapMsg = getMessageFactory().createMessage(null, inputStream, false); return soapMsg; } catch (SOAPException e) { log.error(BundleUtils.getMessage(bundle, "CANNOT_UNMARSHALL_SOAPMESSAGE"), e); IOException e2 = new IOException(e.toString()); e2.initCause(e); throw e2; } }
public static boolean runFilterOnMessage(SOAPMessage msg, FilterType filter) { try { Iterator<?> i = msg.getSOAPBody().getChildElements(); final String xPath = (String)filter.getContent().get(0); while (i.hasNext()) { Element elm = (Element)i.next(); if (FilteringUtil.doesConformToFilter(elm, filter)) { LOG.info("Message passed through filter: " + xPath); } else { LOG.info("Filter " + xPath + " filtered out this message."); return false; } } return true; } catch (SOAPException e) { LOG.severe("SOAPException in runFilterOnMessage: " + e.toString()); return false; } } }
public static boolean runFilterOnMessage(SOAPMessage msg, FilterType filter) { try { Iterator<?> i = msg.getSOAPBody().getChildElements(); final String xPath = (String)filter.getContent().get(0); while (i.hasNext()) { Element elm = (Element)i.next(); if (FilteringUtil.doesConformToFilter(elm, filter)) { LOG.info("Message passed through filter: " + xPath); } else { LOG.info("Filter " + xPath + " filtered out this message."); return false; } } return true; } catch (SOAPException e) { LOG.severe("SOAPException in runFilterOnMessage: " + e.toString()); return false; } } }
private void saveChanges(final MessageContext context) { try { final SOAPMessage message = ((SOAPMessageContext) context).getMessage(); if (message != null) { message.saveChanges(); } } catch (final SOAPException e) { throw new ServerRuntimeException("Unable to save changes to SOAPMessage : " + e.toString()); } }
public Node appendChild(Node newChild) throws DOMException { SOAPHeaderElement headerElement = null; if(newChild instanceof SOAPHeaderElement) headerElement = (SOAPHeaderElement)newChild; else headerElement = new SOAPHeaderElement((Element)newChild); try { addChildElement(headerElement); } catch (SOAPException e) { throw new DOMException(DOMException.INVALID_STATE_ERR,e.toString()); } return headerElement; } }
public Node appendChild(Node newChild) throws DOMException { SOAPHeaderElement headerElement = null; if(newChild instanceof SOAPHeaderElement) headerElement = (SOAPHeaderElement)newChild; else headerElement = new SOAPHeaderElement((Element)newChild); try { addChildElement(headerElement); } catch (SOAPException e) { throw new DOMException(DOMException.INVALID_STATE_ERR,e.toString()); } return headerElement; } }
public Node appendChild(Node newChild) throws DOMException { SOAPHeaderElement headerElement = null; if(newChild instanceof SOAPHeaderElement) headerElement = (SOAPHeaderElement)newChild; else headerElement = new SOAPHeaderElement((Element)newChild); try { addChildElement(headerElement); } catch (SOAPException e) { throw new DOMException(DOMException.INVALID_STATE_ERR,e.toString()); } return headerElement; } }
private void postInvoke(SOAPMessageContext msgContext) { Boolean propFormOptimization = (Boolean)msgContext.getProperty(org.apache.axis.SOAPPart.ALLOW_FORM_OPTIMIZATION); if (propFormOptimization != null && !propFormOptimization.booleanValue()) { msgContext.setProperty(org.apache.axis.SOAPPart.ALLOW_FORM_OPTIMIZATION, Boolean.TRUE); SOAPMessage message = msgContext.getMessage(); ArrayList oldList = (ArrayList)msgContext.getProperty(JAXRPC_METHOD_INFO); if (oldList != null) { if (!Arrays.equals(oldList.toArray(), getMessageInfo(message) .toArray())) { throw new RuntimeException(Messages.getMessage("invocationArgumentsModified00")); } } try { if (message != null) { message.saveChanges(); } } catch (SOAPException e) { log.debug("Exception in postInvoke : ", e); throw new RuntimeException("Exception in postInvoke : " + e.toString()); } } }
private void postInvoke(SOAPMessageContext msgContext) { Boolean propFormOptimization = (Boolean)msgContext.getProperty(org.apache.axis.SOAPPart.ALLOW_FORM_OPTIMIZATION); if (propFormOptimization != null && !propFormOptimization.booleanValue()) { msgContext.setProperty(org.apache.axis.SOAPPart.ALLOW_FORM_OPTIMIZATION, Boolean.TRUE); SOAPMessage message = msgContext.getMessage(); ArrayList oldList = (ArrayList)msgContext.getProperty(JAXRPC_METHOD_INFO); if (oldList != null) { if (!Arrays.equals(oldList.toArray(), getMessageInfo(message) .toArray())) { throw new RuntimeException(Messages.getMessage("invocationArgumentsModified00")); } } try { if (message != null) { message.saveChanges(); } } catch (SOAPException e) { log.debug("Exception in postInvoke : ", e); throw new RuntimeException("Exception in postInvoke : " + e.toString()); } } }
IOException e2 = new IOException(e.toString()); e2.initCause(e); throw e2;
private void postInvoke(SOAPMessageContext msgContext) { Boolean propFormOptimization = (Boolean)msgContext.getProperty(org.apache.axis.SOAPPart.ALLOW_FORM_OPTIMIZATION); if (propFormOptimization != null && !propFormOptimization.booleanValue()) { msgContext.setProperty(org.apache.axis.SOAPPart.ALLOW_FORM_OPTIMIZATION, Boolean.TRUE); SOAPMessage message = msgContext.getMessage(); ArrayList oldList = (ArrayList)msgContext.getProperty(JAXRPC_METHOD_INFO); if (oldList != null) { if (!Arrays.equals(oldList.toArray(), getMessageInfo(message) .toArray())) { throw new RuntimeException(Messages.getMessage("invocationArgumentsModified00")); } } try { if (message != null) { message.saveChanges(); } } catch (SOAPException e) { log.debug("Exception in postInvoke : ", e); throw new RuntimeException("Exception in postInvoke : " + e.toString()); } } }
System.err.println("Error communicating with IP camera at " + hostIP + ": " + e.toString()); e.printStackTrace(); return null;
System.err.println("Error communicating with IP camera at " + hostIP + ": " + e.toString()); e.printStackTrace();