public void handleMessage(SoapMessage message) { if (binding.getHandlerChain().isEmpty()) { return; } if (getInvoker(message).getProtocolHandlers().isEmpty()) { return; } checkUnderstoodHeaders(message); if (getInvoker(message).isOutbound()) { //The SOAPMessage might be set from the outchain, in this case, //we need to clean it up and create a new SOAPMessage dedicated to fault. message.setContent(SOAPMessage.class, null); SAAJ_OUT.handleMessage(message); message.getInterceptorChain().add(ending); } }
public void handleMessage(SoapMessage message) { if (binding.getHandlerChain().isEmpty()) { return; } if (getInvoker(message).getProtocolHandlers().isEmpty()) { return; } checkUnderstoodHeaders(message); MessageContext context = createProtocolMessageContext(message); HandlerChainInvoker invoker = getInvoker(message); invoker.setProtocolMessageContext(context); if (!invoker.invokeProtocolHandlersHandleFault(isRequestor(message), context)) { handleAbort(message, context); } SOAPMessage msg = message.getContent(SOAPMessage.class); if (msg != null) { XMLStreamReader xmlReader = createXMLStreamReaderFromSOAPMessage(msg); message.setContent(XMLStreamReader.class, xmlReader); } }
message.setContent(SOAPMessage.class, soapMessage); message.setContent(XMLStreamWriter.class, writer); message.setContent(SOAPMessage.class, soapMessage);
if (msg != null) { XMLStreamReader xmlReader = createXMLStreamReaderFromSOAPMessage(msg); message.setContent(XMLStreamReader.class, xmlReader);
protected void advanceBody( SoapMessage msg, Node body ) throws SOAPException, XMLStreamException, WSSecurityException { XMLStreamReader reader = StaxUtils.createXMLStreamReader(new DOMSource(body)); // advance just past body int evt = reader.next(); if (reader.hasNext() && evt != XMLStreamConstants.END_ELEMENT) { reader.next(); } msg.setContent(XMLStreamReader.class, reader); }
protected void advanceBody( SoapMessage msg, Node body ) throws SOAPException, XMLStreamException, WSSecurityException { XMLStreamReader reader = StaxUtils.createXMLStreamReader(new DOMSource(body)); // advance just past body int evt = reader.next(); if (reader.hasNext() && evt != XMLStreamConstants.END_ELEMENT) { reader.next(); } msg.setContent(XMLStreamReader.class, reader); }
public void handleMessage(SoapMessage message) throws Fault { XMLStreamReader reader = message.getContent(XMLStreamReader.class); message.setContent(Exception.class, unmarshalFault(message, reader)); }
private void reserialize(SoapMessage message) throws Exception { SOAPMessage soapMessage = message.getContent(SOAPMessage.class); if (soapMessage == null) { return; } DOMSource bodySource = new DOMSource(soapMessage.getSOAPPart()); XMLStreamReader xmlReader = StaxUtils.createXMLStreamReader(bodySource); message.setContent(XMLStreamReader.class, xmlReader); }
private void reserialize(final SoapMessage message) throws Exception { final SOAPMessage soapMessage = message.getContent(SOAPMessage.class); if (soapMessage == null) { return; } final DOMSource bodySource = new DOMSource(soapMessage.getSOAPPart()); final XMLStreamReader xmlReader = StaxUtils.createXMLStreamReader(bodySource); message.setContent(XMLStreamReader.class, xmlReader); } }
private void reserialize(SoapMessage message) throws Exception { SOAPMessage soapMessage = message.getContent(SOAPMessage.class); if (soapMessage == null) { return; } DOMSource bodySource = new DOMSource(soapMessage.getSOAPPart()); XMLStreamReader xmlReader = StaxUtils.createXMLStreamReader(bodySource); message.setContent(XMLStreamReader.class, xmlReader); } }
public static SOAPPart parseSoapMessage(String samlRequest) throws XMLStreamException { XMLStreamReader xmlStreamReader = xmlInputFactory.createXMLStreamReader(new StringReader(samlRequest)); SoapMessage soapMessage = new SoapMessage(Soap11.getInstance()); SAAJInInterceptor.SAAJPreInInterceptor preInInterceptor = new SAAJInInterceptor.SAAJPreInInterceptor(); soapMessage.setContent(XMLStreamReader.class, xmlStreamReader); preInInterceptor.handleMessage(soapMessage); SAAJInInterceptor inInterceptor = new SAAJInInterceptor(); inInterceptor.handleMessage(soapMessage); return ((SOAPPart) soapMessage.getContent(Node.class)); }
@Override public void handleFault(SoapMessage message) { super.handleFault(message); //need to clear these so the fault writing will work correctly message.removeContent(SOAPMessage.class); message.remove(SoapOutInterceptor.WROTE_ENVELOPE_START); XMLStreamWriter writer = (XMLStreamWriter)message.get(ORIGINAL_XML_WRITER); if (writer != null) { message.setContent(XMLStreamWriter.class, writer); message.remove(ORIGINAL_XML_WRITER); } }
@Override public void handleFault(SoapMessage message) { super.handleFault(message); //need to clear these so the fault writing will work correctly message.removeContent(SOAPMessage.class); message.remove(SoapOutInterceptor.WROTE_ENVELOPE_START); XMLStreamWriter writer = (XMLStreamWriter)message.get(ORIGINAL_XML_WRITER); if (writer != null) { message.setContent(XMLStreamWriter.class, writer); message.remove(ORIGINAL_XML_WRITER); } }
public void handleMessage(SoapMessage message) throws Fault { if (message.getVersion() == Soap11.getInstance()) { new Soap11FaultInInterceptor().handleMessage(message); return; } XMLStreamReader reader = message.getContent(XMLStreamReader.class); message.setContent(Exception.class, unmarshalFault(message, reader)); }
public void handleMessage(SoapMessage message) throws Fault { if (message.getVersion() == Soap11.getInstance()) { new Soap11FaultInInterceptor().handleMessage(message); return; } XMLStreamReader reader = message.getContent(XMLStreamReader.class); message.setContent(Exception.class, unmarshalFault(message, reader)); }
@Override public void handleFault(SoapMessage msg) { Set<QName> unknowns = CastUtils.cast((Set<?>)msg.get(MustUnderstandInterceptor.UNKNOWNS)); if (msg.getExchange().getBindingOperationInfo() == null && unknowns != null && !unknowns.isEmpty()) { //per jaxws spec, if there are must understands that we didn't understand, but couldn't map //to an operation either, we need to throw the mustunderstand fault, not the one related to //an unknown operation msg.setContent(Exception.class, new SoapFault(new Message("MUST_UNDERSTAND", BUNDLE, unknowns), msg.getVersion().getMustUnderstand())); } }
public void buildCustomFaultAndSet2SoapMessage(SoapMessage message, FaultType faultType) { Fault exceptionFault = (Fault) message.getContent(Exception.class); // Preserve original FaultMessage for later need String originalFaultMessage = getMessageValueIfThere(exceptionFault); exceptionFault.setMessage(customFaultBuilder.createCustomFaultMessage(faultType)); exceptionFault.setDetail(createFaultDetailWithCustomException(originalFaultMessage, faultType)); message.setContent(Exception.class, exceptionFault); }
public static void buildWeatherFaultAndSet2SoapMessage(SoapMessage message, FaultConst faultContent) { Fault exceptionFault = (Fault) message.getContent(Exception.class); String originalFaultMessage = exceptionFault.getMessage(); exceptionFault.setMessage(faultContent.getMessage()); exceptionFault.setDetail(createFaultDetailWithWeatherException(originalFaultMessage, faultContent)); message.setContent(Exception.class, exceptionFault); }
@Override public void handleFault(SoapMessage msg) { Set<QName> unknowns = CastUtils.cast((Set<?>)msg.get(MustUnderstandInterceptor.UNKNOWNS)); if (msg.getExchange().getBindingOperationInfo() == null && unknowns != null && !unknowns.isEmpty()) { //per jaxws spec, if there are must understands that we didn't understand, but couldn't map //to an operation either, we need to throw the mustunderstand fault, not the one related to //an unknown operation msg.setContent(Exception.class, new SoapFault(new Message("MUST_UNDERSTAND", BUNDLE, unknowns), msg.getVersion().getMustUnderstand())); } }
public static void buildWeatherFaultAndSet2SoapMessage(SoapMessage message, FaultConst faultContent) { Fault exceptionFault = (Fault) message.getContent(Exception.class); String originalFaultMessage = exceptionFault.getMessage(); exceptionFault.setMessage(faultContent.getMessage()); exceptionFault.setDetail(createFaultDetailWithWeatherException(originalFaultMessage, faultContent)); message.setContent(Exception.class, exceptionFault); }