if (m != null && !MessageUtils.isOutbound(message)) { try { SAAJUtils.getBody(m).removeContents(); W3CDOMStreamWriter writer = new W3CDOMStreamWriter(SAAJUtils.getBody(m)); StaxUtils.copy(s, writer);
@Override public Result getPayloadResult() { getSaajBody().removeContents(); return new DOMResult(getSaajBody()); }
@Override public Result getPayloadResult() { getSaajBody().removeContents(); return new DOMResult(getSaajBody()); }
@Override public Result getPayloadResult() { getSaajBody().removeContents(); return new DOMResult(getSaajBody()); }
SOAPMessage originalMsg = message.getContent(SOAPMessage.class); SOAPBody body = originalMsg.getSOAPPart().getEnvelope().getBody(); body.removeContents();
protected Soap12Fault addFault(QName faultCode, String faultString, Locale faultStringLocale) { Assert.notNull(faultCode, "No faultCode given"); Assert.hasLength(faultString, "faultString cannot be empty"); Assert.hasLength(faultCode.getLocalPart(), "faultCode's localPart cannot be empty"); Assert.hasLength(faultCode.getNamespaceURI(), "faultCode's namespaceUri cannot be empty"); try { getSaajBody().removeContents(); SOAPBody body = getSaajBody(); SOAPFault result; if (faultStringLocale == null) { result = body.addFault(faultCode, faultString); } else { result = body.addFault(faultCode, faultString, faultStringLocale); } SOAPFault saajFault = result; return new SaajSoap12Fault(saajFault); } catch (SOAPException ex) { throw new SaajSoapFaultException(ex); } }
protected Soap12Fault addFault(QName faultCode, String faultString, Locale faultStringLocale) { Assert.notNull(faultCode, "No faultCode given"); Assert.hasLength(faultString, "faultString cannot be empty"); Assert.hasLength(faultCode.getLocalPart(), "faultCode's localPart cannot be empty"); Assert.hasLength(faultCode.getNamespaceURI(), "faultCode's namespaceUri cannot be empty"); try { getSaajBody().removeContents(); SOAPBody body = getSaajBody(); SOAPFault result; if (faultStringLocale == null) { result = body.addFault(faultCode, faultString); } else { result = body.addFault(faultCode, faultString, faultStringLocale); } SOAPFault saajFault = result; return new SaajSoap12Fault(saajFault); } catch (SOAPException ex) { throw new SaajSoapFaultException(ex); } }
protected Soap12Fault addFault(QName faultCode, String faultString, Locale faultStringLocale) { Assert.notNull(faultCode, "No faultCode given"); Assert.hasLength(faultString, "faultString cannot be empty"); Assert.hasLength(faultCode.getLocalPart(), "faultCode's localPart cannot be empty"); Assert.hasLength(faultCode.getNamespaceURI(), "faultCode's namespaceUri cannot be empty"); try { getSaajBody().removeContents(); SOAPBody body = getSaajBody(); SOAPFault result; if (faultStringLocale == null) { result = body.addFault(faultCode, faultString); } else { result = body.addFault(faultCode, faultString, faultStringLocale); } SOAPFault saajFault = result; return new SaajSoap12Fault(saajFault); } catch (SOAPException ex) { throw new SaajSoapFaultException(ex); } }
@Override public Soap11Fault addFault(QName faultCode, String faultString, Locale faultStringLocale) { Assert.notNull(faultCode, "No faultCode given"); Assert.hasLength(faultString, "faultString cannot be empty"); Assert.hasLength(faultCode.getLocalPart(), "faultCode's localPart cannot be empty"); Assert.hasLength(faultCode.getNamespaceURI(), "faultCode's namespaceUri cannot be empty"); if (!langAttributeOnSoap11FaultString) { faultStringLocale = null; } try { getSaajBody().removeContents(); SOAPBody body = getSaajBody(); SOAPFault result; if (faultStringLocale == null) { result = body.addFault(faultCode, faultString); } else { result = body.addFault(faultCode, faultString, faultStringLocale); } SOAPFault saajFault = result; return new SaajSoap11Fault(saajFault); } catch (SOAPException ex) { throw new SaajSoapFaultException(ex); } }
@Override public Soap11Fault addFault(QName faultCode, String faultString, Locale faultStringLocale) { Assert.notNull(faultCode, "No faultCode given"); Assert.hasLength(faultString, "faultString cannot be empty"); Assert.hasLength(faultCode.getLocalPart(), "faultCode's localPart cannot be empty"); Assert.hasLength(faultCode.getNamespaceURI(), "faultCode's namespaceUri cannot be empty"); if (!langAttributeOnSoap11FaultString) { faultStringLocale = null; } try { getSaajBody().removeContents(); SOAPBody body = getSaajBody(); SOAPFault result; if (faultStringLocale == null) { result = body.addFault(faultCode, faultString); } else { result = body.addFault(faultCode, faultString, faultStringLocale); } SOAPFault saajFault = result; return new SaajSoap11Fault(saajFault); } catch (SOAPException ex) { throw new SaajSoapFaultException(ex); } }
@Override public Soap11Fault addFault(QName faultCode, String faultString, Locale faultStringLocale) { Assert.notNull(faultCode, "No faultCode given"); Assert.hasLength(faultString, "faultString cannot be empty"); Assert.hasLength(faultCode.getLocalPart(), "faultCode's localPart cannot be empty"); Assert.hasLength(faultCode.getNamespaceURI(), "faultCode's namespaceUri cannot be empty"); if (!langAttributeOnSoap11FaultString) { faultStringLocale = null; } try { getSaajBody().removeContents(); SOAPBody body = getSaajBody(); SOAPFault result; if (faultStringLocale == null) { result = body.addFault(faultCode, faultString); } else { result = body.addFault(faultCode, faultString, faultStringLocale); } SOAPFault saajFault = result; return new SaajSoap11Fault(saajFault); } catch (SOAPException ex) { throw new SaajSoapFaultException(ex); } }
public void addFault(com.sun.xml.wss.impl.WssSoapFaultException sfe,SOAPMessage soapMessage,boolean isSOAP12)throws SOAPException{ SOAPBody body = soapMessage.getSOAPBody(); body.removeContents(); soapMessage.removeAllAttachments(); QName faultCode = sfe.getFaultCode(); Name faultCodeName = null; if(faultCode == null){ faultCode = new QName(SOAPConstants.URI_NS_SOAP_ENVELOPE,"Client"); } if(isSOAP12){ SOAPFault fault = body.addFault(SOAPConstants.SOAP_SENDER_FAULT,sfe.getMessage()); fault.appendFaultSubcode(faultCode); }else{ body.addFault(faultCode, sfe.getMessage()); } NodeList list = soapMessage.getSOAPPart().getEnvelope().getElementsByTagNameNS(MessageConstants.WSSE_NS,MessageConstants.WSSE_SECURITY_LNAME); if(list.getLength() > 0){ Node node = list.item(0); node.getParentNode().removeChild(node); } } }
public void addFault( com.sun.xml.wss.impl.WssSoapFaultException sfe,SOAPMessage soapMessage,boolean isSOAP12) throws SOAPException{ SOAPBody body = soapMessage.getSOAPBody(); body.removeContents(); soapMessage.removeAllAttachments(); QName faultCode = sfe.getFaultCode(); Name faultCodeName = null; if(faultCode == null){ faultCode = new QName(SOAPConstants.URI_NS_SOAP_ENVELOPE,"Client"); } if(isSOAP12){ SOAPFault fault = body.addFault(SOAPConstants.SOAP_SENDER_FAULT,sfe.getMessage()); fault.appendFaultSubcode(faultCode); }else{ body.addFault(faultCode, sfe.getMessage()); } NodeList list = soapMessage.getSOAPPart().getEnvelope().getElementsByTagNameNS(MessageConstants.WSSE_NS,MessageConstants.WSSE_SECURITY_LNAME); if(list.getLength() > 0){ Node node = list.item(0); node.getParentNode().removeChild(node); } }
body.removeContents(); QName faultCode = sfe.getFaultCode(); Name faultCodeName = null;
/** * Sets the request parameters for a request. * * @param context * the message context * @param params * list of parameters to set in order * @throws SoapFault */ protected void setSOAPRequestObjects(SOAPMessageContext context, List<SOAPElement> params) { // Extract the SOAP Message SOAPMessage message = context.getMessage(); // Get the envelope body SOAPBody body; try { body = message.getSOAPBody(); } catch (SOAPException e) { throw CXFUtility.getFault(e); } try { body.removeContents(); for (SOAPElement p : params) { body.addChildElement(p); } } catch (Exception e) { logger.error("Problem changing SOAP message contents", e); throw CXFUtility.getFault(e); } }
msg.getSOAPBody().removeContents();
if (m != null && !MessageUtils.isOutbound(message)) { try { SAAJUtils.getBody(m).removeContents(); W3CDOMStreamWriter writer = new W3CDOMStreamWriter(SAAJUtils.getBody(m)); StaxUtils.copy(s, writer);
SOAPMessage originalMsg = message.getContent(SOAPMessage.class); SOAPBody body = originalMsg.getSOAPPart().getEnvelope().getBody(); body.removeContents();