@Override public Soap11Fault addVersionMismatchFault(String faultString, Locale locale) { SOAPFault fault = addStandardFault(SOAP11Constants.FAULT_CODE_VERSION_MISMATCH, faultString, locale); return new AxiomSoap11Fault(fault, getAxiomFactory()); }
@Override public Soap11Fault getFault() { SOAPFault axiomFault = getAxiomBody().getFault(); return axiomFault != null ? new AxiomSoap11Fault(axiomFault, getAxiomFactory()) : null; }
public Soap11Fault addFault(QName code, String faultString, Locale faultStringLocale) { Assert.notNull(code, "No faultCode given"); Assert.hasLength(faultString, "faultString cannot be empty"); if (!StringUtils.hasLength(code.getNamespaceURI())) { throw new IllegalArgumentException( "A fault code with namespace and local part must be specific for a custom fault code"); } if (!langAttributeOnSoap11FaultString) { faultStringLocale = null; } try { AxiomUtils.removeContents(getAxiomBody()); SOAPFault fault = getAxiomFactory().createSOAPFault(getAxiomBody()); SOAPFaultCode faultCode = getAxiomFactory().createSOAPFaultCode(fault); setValueText(code, fault, faultCode); SOAPFaultReason faultReason = getAxiomFactory().createSOAPFaultReason(fault); if (faultStringLocale != null) { addLangAttribute(faultStringLocale, faultReason); } faultReason.setText(faultString); return new AxiomSoap11Fault(fault, getAxiomFactory()); } catch (SOAPProcessingException ex) { throw new AxiomSoapFaultException(ex); } }
private SOAPFault addStandardFault(String localName, String faultString, Locale locale) { Assert.notNull(faultString, "No faultString given"); try { AxiomUtils.removeContents(getAxiomBody()); SOAPFault fault = getAxiomFactory().createSOAPFault(getAxiomBody()); SOAPFaultCode faultCode = getAxiomFactory().createSOAPFaultCode(fault); faultCode.setText(new QName(fault.getNamespace().getNamespaceURI(), localName, fault.getNamespace().getPrefix())); SOAPFaultReason faultReason = getAxiomFactory().createSOAPFaultReason(fault); if (locale != null) { addLangAttribute(locale, faultReason); } faultReason.setText(faultString); return fault; } catch (SOAPProcessingException ex) { throw new AxiomSoapFaultException(ex); } }
private void addLangAttribute(Locale locale, SOAPFaultReason faultReason) { OMNamespace xmlNamespace = getAxiomFactory().createOMNamespace("http://www.w3.org/XML/1998/namespace", "xml"); OMAttribute langAttribute = getAxiomFactory().createOMAttribute("lang", xmlNamespace, AxiomUtils.toLanguage(locale)); faultReason.addAttribute(langAttribute); }
public SoapBody getBody() { if (body == null) { try { SOAPBody axiomBody = getAxiomEnvelope().getBody(); String namespaceURI = getAxiomEnvelope().getNamespace().getNamespaceURI(); if (SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(namespaceURI)) { body = new AxiomSoap11Body(axiomBody, getAxiomFactory(), payloadCaching, langAttributeOnSoap11FaultString); } else if (SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(namespaceURI)) { body = new AxiomSoap12Body(axiomBody, getAxiomFactory(), payloadCaching); } else { throw new AxiomSoapEnvelopeException("Unknown SOAP namespace \"" + namespaceURI + "\""); } } catch (OMException ex) { throw new AxiomSoapBodyException(ex); } } return body; }
@Override public Soap11Fault addFault(QName code, String faultString, Locale faultStringLocale) { Assert.notNull(code, "No faultCode given"); Assert.hasLength(faultString, "faultString cannot be empty"); if (!StringUtils.hasLength(code.getNamespaceURI())) { throw new IllegalArgumentException( "A fault code with namespace and local part must be specific for a custom fault code"); } if (!langAttributeOnSoap11FaultString) { faultStringLocale = null; } try { AxiomUtils.removeContents(getAxiomBody()); SOAPFault fault = getAxiomFactory().createSOAPFault(getAxiomBody()); SOAPFaultCode faultCode = getAxiomFactory().createSOAPFaultCode(fault); setValueText(code, fault, faultCode); SOAPFaultReason faultReason = getAxiomFactory().createSOAPFaultReason(fault); if (faultStringLocale != null) { addLangAttribute(faultStringLocale, faultReason); } faultReason.setText(faultString); return new AxiomSoap11Fault(fault, getAxiomFactory()); } catch (SOAPProcessingException ex) { throw new AxiomSoapFaultException(ex); } }
private SOAPFault addStandardFault(String localName, String faultString, Locale locale) { Assert.notNull(faultString, "No faultString given"); try { AxiomUtils.removeContents(getAxiomBody()); SOAPFault fault = getAxiomFactory().createSOAPFault(getAxiomBody()); SOAPFaultCode faultCode = getAxiomFactory().createSOAPFaultCode(fault); faultCode.setText(new QName(fault.getNamespace().getNamespaceURI(), localName, fault.getNamespace().getPrefix())); SOAPFaultReason faultReason = getAxiomFactory().createSOAPFaultReason(fault); if (locale != null) { addLangAttribute(locale, faultReason); } faultReason.setText(faultString); return fault; } catch (SOAPProcessingException ex) { throw new AxiomSoapFaultException(ex); } }
private void addLangAttribute(Locale locale, SOAPFaultReason faultReason) { OMNamespace xmlNamespace = getAxiomFactory().createOMNamespace("http://www.w3.org/XML/1998/namespace", "xml"); OMAttribute langAttribute = getAxiomFactory().createOMAttribute("lang", xmlNamespace, AxiomUtils.toLanguage(locale)); faultReason.addAttribute(langAttribute); }
@Override public SoapBody getBody() { if (body == null) { try { SOAPBody axiomBody = getAxiomEnvelope().getBody(); String namespaceURI = getAxiomEnvelope().getNamespace().getNamespaceURI(); if (SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(namespaceURI)) { body = new AxiomSoap11Body(axiomBody, getAxiomFactory(), payloadCaching, langAttributeOnSoap11FaultString); } else if (SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(namespaceURI)) { body = new AxiomSoap12Body(axiomBody, getAxiomFactory(), payloadCaching); } else { throw new AxiomSoapEnvelopeException("Unknown SOAP namespace \"" + namespaceURI + "\""); } } catch (OMException ex) { throw new AxiomSoapBodyException(ex); } } return body; }
@Override public Soap11Fault addClientOrSenderFault(String faultString, Locale locale) { SOAPFault fault = addStandardFault(SOAP11Constants.FAULT_CODE_SENDER, faultString, locale); return new AxiomSoap11Fault(fault, getAxiomFactory()); }
@Override public Soap11Fault addFault(QName code, String faultString, Locale faultStringLocale) { Assert.notNull(code, "No faultCode given"); Assert.hasLength(faultString, "faultString cannot be empty"); if (!StringUtils.hasLength(code.getNamespaceURI())) { throw new IllegalArgumentException( "A fault code with namespace and local part must be specific for a custom fault code"); } if (!langAttributeOnSoap11FaultString) { faultStringLocale = null; } try { AxiomUtils.removeContents(getAxiomBody()); SOAPFault fault = getAxiomFactory().createSOAPFault(getAxiomBody()); SOAPFaultCode faultCode = getAxiomFactory().createSOAPFaultCode(fault); setValueText(code, fault, faultCode); SOAPFaultReason faultReason = getAxiomFactory().createSOAPFaultReason(fault); if (faultStringLocale != null) { addLangAttribute(faultStringLocale, faultReason); } faultReason.setText(faultString); return new AxiomSoap11Fault(fault, getAxiomFactory()); } catch (SOAPProcessingException ex) { throw new AxiomSoapFaultException(ex); } }
private SOAPFault addStandardFault(String localName, String faultString, Locale locale) { Assert.notNull(faultString, "No faultString given"); try { AxiomUtils.removeContents(getAxiomBody()); SOAPFault fault = getAxiomFactory().createSOAPFault(getAxiomBody()); SOAPFaultCode faultCode = getAxiomFactory().createSOAPFaultCode(fault); faultCode.setText(new QName(fault.getNamespace().getNamespaceURI(), localName, fault.getNamespace().getPrefix())); SOAPFaultReason faultReason = getAxiomFactory().createSOAPFaultReason(fault); if (locale != null) { addLangAttribute(locale, faultReason); } faultReason.setText(faultString); return fault; } catch (SOAPProcessingException ex) { throw new AxiomSoapFaultException(ex); } }
public Soap11Fault getFault() { SOAPFault axiomFault = getAxiomBody().getFault(); return axiomFault != null ? new AxiomSoap11Fault(axiomFault, getAxiomFactory()) : null; }
private void addLangAttribute(Locale locale, SOAPFaultReason faultReason) { OMNamespace xmlNamespace = getAxiomFactory().createOMNamespace("http://www.w3.org/XML/1998/namespace", "xml"); OMAttribute langAttribute = getAxiomFactory().createOMAttribute("lang", xmlNamespace, AxiomUtils.toLanguage(locale)); faultReason.addAttribute(langAttribute); }
@Override public SoapBody getBody() { if (body == null) { try { SOAPBody axiomBody = getAxiomEnvelope().getBody(); String namespaceURI = getAxiomEnvelope().getNamespace().getNamespaceURI(); if (SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(namespaceURI)) { body = new AxiomSoap11Body(axiomBody, getAxiomFactory(), payloadCaching, langAttributeOnSoap11FaultString); } else if (SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(namespaceURI)) { body = new AxiomSoap12Body(axiomBody, getAxiomFactory(), payloadCaching); } else { throw new AxiomSoapEnvelopeException("Unknown SOAP namespace \"" + namespaceURI + "\""); } } catch (OMException ex) { throw new AxiomSoapBodyException(ex); } } return body; }
@Override public Soap11Fault addMustUnderstandFault(String faultString, Locale locale) { SOAPFault fault = addStandardFault(SOAP11Constants.FAULT_CODE_MUST_UNDERSTAND, faultString, locale); return new AxiomSoap11Fault(fault, getAxiomFactory()); }
@Override public Soap11Fault addFault(QName code, String faultString, Locale faultStringLocale) { Assert.notNull(code, "No faultCode given"); Assert.hasLength(faultString, "faultString cannot be empty"); if (!StringUtils.hasLength(code.getNamespaceURI())) { throw new IllegalArgumentException( "A fault code with namespace and local part must be specific for a custom fault code"); } if (!langAttributeOnSoap11FaultString) { faultStringLocale = null; } try { AxiomUtils.removeContents(getAxiomBody()); SOAPFault fault = getAxiomFactory().createSOAPFault(getAxiomBody()); SOAPFaultCode faultCode = getAxiomFactory().createSOAPFaultCode(fault); setValueText(code, fault, faultCode); SOAPFaultReason faultReason = getAxiomFactory().createSOAPFaultReason(fault); if (faultStringLocale != null) { addLangAttribute(faultStringLocale, faultReason); } faultReason.setText(faultString); return new AxiomSoap11Fault(fault, getAxiomFactory()); } catch (SOAPProcessingException ex) { throw new AxiomSoapFaultException(ex); } }
private SOAPFault addStandardFault(String localName, String faultString, Locale locale) { Assert.notNull(faultString, "No faultString given"); try { AxiomUtils.removeContents(getAxiomBody()); SOAPFault fault = getAxiomFactory().createSOAPFault(getAxiomBody()); SOAPFaultCode faultCode = getAxiomFactory().createSOAPFaultCode(fault); faultCode.setText(QNameUtils.createQName(fault.getNamespace().getNamespaceURI(), localName, fault.getNamespace().getPrefix())); SOAPFaultReason faultReason = getAxiomFactory().createSOAPFaultReason(fault); if (locale != null) { addLangAttribute(locale, faultReason); } faultReason.setText(faultString); return fault; } catch (SOAPProcessingException ex) { throw new AxiomSoapFaultException(ex); } }
@Override public Soap11Fault getFault() { SOAPFault axiomFault = getAxiomBody().getFault(); return axiomFault != null ? new AxiomSoap11Fault(axiomFault, getAxiomFactory()) : null; }