@Override public void appendFaultSubcode(SOAPFault fault, QName subcode) throws SOAPException { fault.appendFaultSubcode(subcode); }
soapFault.appendFaultSubcode(fsc);
@Override public void addFaultSubcode(QName subcode) { try { getSaajFault().appendFaultSubcode(subcode); } catch (SOAPException ex) { throw new SaajSoapFaultException(ex); } }
@Override public void addFaultSubcode(QName subcode) { try { getSaajFault().appendFaultSubcode(subcode); } catch (SOAPException ex) { throw new SaajSoapFaultException(ex); } }
@Override public void addFaultSubcode(QName subcode) { try { getSaajFault().appendFaultSubcode(subcode); } catch (SOAPException ex) { throw new SaajSoapFaultException(ex); } }
/** * Recursively populate the Subcodes */ private void fillFaultSubCodes(SOAPFault fault, SubcodeType subcode) throws SOAPException { if(subcode != null){ fault.appendFaultSubcode(subcode.getValue()); fillFaultSubCodes(fault, subcode.getSubcode()); } }
/** * Recursively populate the Subcodes */ private void fillFaultSubCodes(SOAPFault fault, SubcodeType subcode) throws SOAPException { if(subcode != null){ fault.appendFaultSubcode(subcode.getValue()); fillFaultSubCodes(fault, subcode.getSubcode()); } }
/** * Recursively populate the Subcodes */ private void fillFaultSubCodes(SOAPFault fault, SubcodeType subcode) throws SOAPException { if(subcode != null){ fault.appendFaultSubcode(subcode.getValue()); fillFaultSubCodes(fault, subcode.getSubcode()); } }
protected static SOAPFault getSOAPFault(QName faultCode, String faultString, SOAPFactory soapFactory, SOAPVersion version) { SOAPFault fault = null; try { if (version == SOAPVersion.SOAP_12) { fault = soapFactory.createFault(faultString, SOAPConstants.SOAP_SENDER_FAULT); fault.appendFaultSubcode(faultCode); } else { fault = soapFactory.createFault(faultString, faultCode); } } catch (Exception e) { throw new XWSSecurityRuntimeException(e); } return fault; }
public static void setFaultCode(SOAPFault f, QName code) throws SOAPException { if (f.getNamespaceURI().equals(Soap12.SOAP_NAMESPACE)) { try { f.setFaultCode(code); } catch (SOAPException ex) { f.setFaultCode(SOAPConstants.SOAP_SENDER_FAULT); f.appendFaultSubcode(code); } } else { try { f.setFaultCode(code); } catch (Throwable t) { int count = 1; String pfx = "fc1"; while (!StringUtils.isEmpty(f.getNamespaceURI(pfx))) { count++; pfx = "fc" + count; } if (code.getNamespaceURI() != null && !"".equals(code.getNamespaceURI())) { f.addNamespaceDeclaration(pfx, code.getNamespaceURI()); } else { f.addNamespaceDeclaration(pfx, f.getNamespaceURI()); } f.setFaultCode(pfx + ":" + code.getLocalPart()); } } }
protected SOAPFault getSOAPFault(WssSoapFaultException sfe) { SOAPFault fault = null; try { if (isSOAP12) { fault = soapFactory.createFault(sfe.getFaultString(),SOAPConstants.SOAP_SENDER_FAULT); fault.appendFaultSubcode(sfe.getFaultCode()); } else { fault = soapFactory.createFault(sfe.getFaultString(), sfe.getFaultCode()); } } catch (Exception e) { throw new RuntimeException("Security Pipe: Internal Error while trying to create a SOAPFault"); } return fault; }
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); } }
@Override protected Object makeCallError(String uniqueId, String action, String errorCode, String errorDescription) { SOAPMessage message = null; try { MessageFactory messageFactory = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL); message = messageFactory.createMessage(); message.setProperty(SOAPMessage.WRITE_XML_DECLARATION, "true"); createMessageHeader(uniqueId, String.format("%sResponse", action), true, message); SOAPFault soapFault = message.getSOAPBody().addFault(); soapFault.setFaultCode(blameSomeone(errorCode)); soapFault.setFaultString(errorDescription); soapFault.appendFaultSubcode(new QName(hostInfo.getNamespace(), errorCode)); } catch (SOAPException e) { logger.warn("makeCallError() failed", e); } return message; }
public SOAPFaultException getSOAPFaultException( WssSoapFaultException sfe, boolean isSOAP12) { SOAPFault fault = null; try { if (isSOAP12) { fault = soapFactory.createFault(sfe.getFaultString(),SOAPConstants.SOAP_SENDER_FAULT); fault.appendFaultSubcode(sfe.getFaultCode()); } else { fault = soapFactory.createFault(sfe.getFaultString(), sfe.getFaultCode()); } } catch (Exception e) { throw new RuntimeException(this + ": Internal Error while trying to create a SOAPFault"); } return new SOAPFaultException(fault); }
public SOAPFaultException getSOAPFaultException( WssSoapFaultException sfe, boolean isSOAP12) { SOAPFault fault = null; try { if (isSOAP12) { fault = soapFactory.createFault(sfe.getFaultString(),SOAPConstants.SOAP_SENDER_FAULT); fault.appendFaultSubcode(sfe.getFaultCode()); } else { fault = soapFactory.createFault(sfe.getFaultString(), sfe.getFaultCode()); } } catch (Exception e) { throw new RuntimeException(this + ": Internal Error while trying to create a SOAPFault"); } return new SOAPFaultException(fault); }
public SOAPFaultException getSOAPFaultException( WssSoapFaultException sfe, boolean isSOAP12) { SOAPFault fault = null; try { if (isSOAP12) { fault = sf12.createFault(sfe.getFaultString(),SOAPConstants.SOAP_SENDER_FAULT); fault.appendFaultSubcode(sfe.getFaultCode()); } else { fault = sf11.createFault(sfe.getFaultString(), sfe.getFaultCode()); } } catch (Exception e) { throw new RuntimeException("com.sun.xml.rpc.security.SystemHandlerDelegateImpl: Internal Error while trying to create a SOAPFault"); } return new SOAPFaultException(fault); }
public SOAPFault newMapRequiredFault(MissingAddressingHeaderException e) { QName subcode = addVer.mapRequiredTag; QName subsubcode = addVer.mapRequiredTag; String faultstring = addVer.getMapRequiredText(); try { SOAPFactory factory; SOAPFault fault; if (soapVer == SOAPVersion.SOAP_12) { factory = SOAPVersion.SOAP_12.getSOAPFactory(); fault = factory.createFault(); fault.setFaultCode(SOAPConstants.SOAP_SENDER_FAULT); fault.appendFaultSubcode(subcode); fault.appendFaultSubcode(subsubcode); getMapRequiredDetail(e.getMissingHeaderQName(), fault.addDetail()); } else { factory = SOAPVersion.SOAP_11.getSOAPFactory(); fault = factory.createFault(); fault.setFaultCode(subsubcode); } fault.setFaultString(faultstring); return fault; } catch (SOAPException se) { throw new WebServiceException(se); } }
public SOAPFault newMapRequiredFault(MissingAddressingHeaderException e) { QName subcode = addVer.mapRequiredTag; QName subsubcode = addVer.mapRequiredTag; String faultstring = addVer.getMapRequiredText(); try { SOAPFactory factory; SOAPFault fault; if (soapVer == SOAPVersion.SOAP_12) { factory = SOAPVersion.SOAP_12.getSOAPFactory(); fault = factory.createFault(); fault.setFaultCode(SOAPConstants.SOAP_SENDER_FAULT); fault.appendFaultSubcode(subcode); fault.appendFaultSubcode(subsubcode); getMapRequiredDetail(e.getMissingHeaderQName(), fault.addDetail()); } else { factory = SOAPVersion.SOAP_11.getSOAPFactory(); fault = factory.createFault(); fault.setFaultCode(subsubcode); } fault.setFaultString(faultstring); return fault; } catch (SOAPException se) { throw new WebServiceException(se); } }
protected static SOAPFault getSOAPFault(WssSoapFaultException sfe, SOAPFactory soapFactory, SOAPVersion version) { SOAPFault fault = null; String reasonText = sfe.getFaultString(); if (reasonText == null) { reasonText = (sfe.getMessage() != null) ? sfe.getMessage() : ""; } try { if (version == SOAPVersion.SOAP_12) { fault = soapFactory.createFault(reasonText, SOAPConstants.SOAP_SENDER_FAULT); fault.appendFaultSubcode(sfe.getFaultCode()); } else { fault = soapFactory.createFault(reasonText, sfe.getFaultCode()); } } catch (Exception e) { throw new XWSSecurityRuntimeException(e); } return fault; }