public void setFaultReasonText(Locale locale, String text) { SOAPFaultReason faultReason = getAxiomFault().getReason(); String language = AxiomUtils.toLanguage(locale); try { SOAPFaultText faultText = getAxiomFactory().createSOAPFaultText(faultReason); faultText.setLang(language); faultText.setText(text); } catch (SOAPProcessingException ex) { throw new AxiomSoapFaultException(ex); } }
/** * getText() is overridden here in order to provide a uniform way for SOAP 1.1 * and SOAP 1.2 to get the "default" reason string. * * @return the default (local language, or first) reason string */ public String getText() { // TODO: Make this look for the correct lang for our locale first return getFirstSOAPText().getText(); }
} else { SOAPFaultText sft = sf.createSOAPFaultText(); sft.setText(newReason); sfr.addSOAPText(sft);
public SOAPFaultText getSOAPFaultText(String language) { Iterator childrenIter = this.getChildren(); while (childrenIter.hasNext()) { OMNode node = (OMNode) childrenIter.next(); if (node.getType() == OMNode.ELEMENT_NODE && (node instanceof SOAPFaultText) && (language == null || language.equals(((SOAPFaultText) node).getLang()))) { return (SOAPFaultText) node; } } return null; } }
soapFaultText.setText(serviceException.getMessage());
while (faultReasons.hasNext()) { SOAPFaultText soapFaultText = (SOAPFaultText)faultReasons.next(); String lang = soapFaultText.getLang(); if (lang == null) { faultReasonLocales.add(Locale.getDefault());
@Override public void setFaultReasonText(Locale locale, String text) { SOAPFaultReason faultReason = getAxiomFault().getReason(); String language = AxiomUtils.toLanguage(locale); try { SOAPFaultText faultText = getAxiomFactory().createSOAPFaultText(faultReason); faultText.setLang(language); faultText.setText(text); } catch (SOAPProcessingException ex) { throw new AxiomSoapFaultException(ex); } }
soapFaultText.setText("The input document cannot be null."); fault.setReason(soapFaultReason);
/** * Returns an Iterator over a sequence of String objects containing all of the Reason Text items * for this SOAPFault. * * @throws SOAPException if there is an error in retrieving texts for Reason objects * java.lang.UnsupportedOperationException - if this message does not * support the SOAP 1.2 concept of Fault Reason. */ public Iterator getFaultReasonTexts() throws SOAPException { if (((SOAPFactory)this.omTarget.getOMFactory()).getSOAPVersion() == SOAPVersion.SOAP11) { throw new UnsupportedOperationException(); } Iterator soapTextsItr = this.omTarget.getReason().getAllSoapTexts().iterator(); ArrayList reasonTexts = new ArrayList(); while (soapTextsItr.hasNext()) { SOAPFaultText soapFaultText = (SOAPFaultText)soapTextsItr.next(); reasonTexts.add(soapFaultText.getText()); } return reasonTexts.iterator(); }
while (faultReasons.hasNext()) { SOAPFaultText soapFaultText = (SOAPFaultText)faultReasons.next(); String lang = soapFaultText.getLang(); if (lang == null) { faultReasonLocales.add(Locale.getDefault());
@Override public void setFaultReasonText(Locale locale, String text) { SOAPFaultReason faultReason = getAxiomFault().getReason(); String language = AxiomUtils.toLanguage(locale); try { SOAPFaultText faultText = getAxiomFactory().createSOAPFaultText(faultReason); faultText.setLang(language); faultText.setText(text); } catch (SOAPProcessingException ex) { throw new AxiomSoapFaultException(ex); } }
SOAPFaultReason soapFaultReason = soapFactory.createSOAPFaultReason(); SOAPFaultText soapFaultText = soapFactory.createSOAPFaultText(); soapFaultText.setText(reason); soapFaultReason.addSOAPText(soapFaultText); message.getBody().getFault().setReason(soapFaultReason);
/** * Returns an Iterator over a sequence of String objects containing all of the Reason Text items * for this SOAPFault. * * @throws SOAPException if there is an error in retrieving texts for Reason objects * java.lang.UnsupportedOperationException - if this message does not * support the SOAP 1.2 concept of Fault Reason. */ public Iterator getFaultReasonTexts() throws SOAPException { if (((SOAPFactory)this.omTarget.getOMFactory()).getSOAPVersion() == SOAP11Version.getSingleton()) { throw new UnsupportedOperationException(); } Iterator soapTextsItr = this.omTarget.getReason().getAllSoapTexts().iterator(); ArrayList reasonTexts = new ArrayList(); while (soapTextsItr.hasNext()) { SOAPFaultText soapFaultText = (SOAPFaultText)soapTextsItr.next(); reasonTexts.add(soapFaultText.getText()); } return reasonTexts.iterator(); }
@Override public void setFaultReasonText(Locale locale, String text) { SOAPFaultReason faultReason = getAxiomFault().getReason(); String language = AxiomUtils.toLanguage(locale); try { SOAPFaultText faultText = getAxiomFactory().createSOAPFaultText(faultReason); faultText.setLang(language); faultText.setText(text); } catch (SOAPProcessingException ex) { throw new AxiomSoapFaultException(ex); } }
SOAPFaultReason soapFaultReason = soapFactory.createSOAPFaultReason(); SOAPFaultText soapFaultText = soapFactory.createSOAPFaultText(); soapFaultText.setText(reason); soapFaultReason.addSOAPText(soapFaultText); message.getBody().getFault().setReason(soapFaultReason);