private static void setFaultCodeForSOAP12(MessageContext msgContext, QName faultCode, QName faultSubcode) throws AxisFault { SOAPFactory factory = OMAbstractFactory.getSOAP12Factory(); SOAPFaultCode soapFaultCode = factory.createSOAPFaultCode(); SOAPFaultValue soapFaultValue = factory.createSOAPFaultValue(soapFaultCode); soapFaultValue.setText(faultCode.getPrefix() + ":" + faultCode.getLocalPart()); SOAPFaultSubCode soapFaultSubCode = factory .createSOAPFaultSubCode(soapFaultCode); SOAPFaultValue soapFaultSubCodeValue = factory .createSOAPFaultValue(soapFaultSubCode); soapFaultSubCodeValue.setText(faultSubcode.getPrefix() + ":" + faultSubcode.getLocalPart()); msgContext.setProperty(SOAP12Constants.SOAP_FAULT_CODE_LOCAL_NAME, soapFaultCode); }
private void setFaultCode(MessageContext synCtx, SOAPFactory factory, SOAPFault fault, int soapVersion) { QName fault_code = null; if (faultCodeValue == null && faultCodeExpr == null) { handleException("A valid fault code QName value or expression is required", synCtx); } else if (faultCodeValue != null) { fault_code = faultCodeValue; } else { String codeStr = faultCodeExpr.stringValueOf(synCtx); fault_code = new QName(fault.getNamespace().getNamespaceURI(),codeStr); } SOAPFaultCode code = factory.createSOAPFaultCode(); switch (soapVersion) { case SOAP11: code.setText(fault_code); break; case SOAP12: SOAPFaultValue value = factory.createSOAPFaultValue(code); value.setText(fault_code); break; } fault.setCode(code); }
private void setFaultCode(MessageContext synCtx, SOAPFactory factory, SOAPFault fault, int soapVersion) { QName fault_code = null; if (faultCodeValue == null && faultCodeExpr == null) { handleException("A valid fault code QName value or expression is required", synCtx); } else if (faultCodeValue != null) { fault_code = faultCodeValue; } else { String codeStr = faultCodeExpr.stringValueOf(synCtx); fault_code = new QName(fault.getNamespace().getNamespaceURI(),codeStr); } SOAPFaultCode code = factory.createSOAPFaultCode(); switch (soapVersion) { case SOAP11: code.setText(fault_code); break; case SOAP12: SOAPFaultValue value = factory.createSOAPFaultValue(code); value.setText(fault_code); break; } fault.setCode(code); }
soapFactory.createSOAPFaultValue(soapFaultSubCode); soapFaultValueimpl.setText(subcode.getPrefix() + ":" + subcode.getLocalPart()); soapFaultValueimpl.declareNamespace(subcode.getNamespaceURI(), subcode.getPrefix());
soapFactory.createSOAPFaultValue(soapFaultSubCode); soapFaultValueimpl.setText(subcode.getPrefix() + ":" + subcode.getLocalPart()); soapFaultValueimpl.declareNamespace(subcode.getNamespaceURI(), subcode.getPrefix());
soapFaultCode.setText(faultCode); } else { SOAPFaultValue soapFaultValue = soapFac.createSOAPFaultValue(soapFaultCode); soapFaultValue.setText(SOAP12Constants.SOAP_DEFAULT_NAMESPACE_PREFIX + ":" + SOAP12Constants.FAULT_CODE_SENDER); SOAPFaultSubCode soapFaultSubCode = soapFac.createSOAPFaultSubCode(soapFaultCode); SOAPFaultValue soapFaultSubcodeValue = soapFac.createSOAPFaultValue(soapFaultSubCode); soapFac.createSOAPFaultSubCode(soapFaultSubCode); SOAPFaultValue soapFaultSubcodeValue2 = soapFac.createSOAPFaultValue(soapFaultSubCode2); String namespace = (String) messageContext.getProperty(AddressingConstants.WS_ADDRESSING_VERSION);
message.getBody().getFault().setReason(soapFaultReason); SOAPFaultCode soapFaultCode = soapFactory.createSOAPFaultCode(); SOAPFaultValue soapFaultValue = soapFactory.createSOAPFaultValue(soapFaultCode); soapFaultValue.setText(code); soapFaultCode.setValue(soapFaultValue); SOAPFaultSubCode soapFaultSubCode = soapFactory.createSOAPFaultSubCode(soapFaultCode); SOAPFaultValue soapFaultValueSub = soapFactory.createSOAPFaultValue(soapFaultSubCode); QName qNameSubCode = new QName("http://wso2.org/passivests", subCode, "sts"); soapFaultValueSub.setText(qNameSubCode);
message.getBody().getFault().setReason(soapFaultReason); SOAPFaultCode soapFaultCode = soapFactory.createSOAPFaultCode(); SOAPFaultValue soapFaultValue = soapFactory.createSOAPFaultValue(soapFaultCode); soapFaultValue.setText(code); soapFaultCode.setValue(soapFaultValue); SOAPFaultSubCode soapFaultSubCode = soapFactory.createSOAPFaultSubCode(soapFaultCode); SOAPFaultValue soapFaultValueSub = soapFactory.createSOAPFaultValue(soapFaultSubCode); QName qNameSubCode = new QName("http://wso2.org/passivests", subCode, "sts"); soapFaultValueSub.setText(qNameSubCode);
SOAPFaultValue faultCodeValue = fac.createSOAPFaultValue(faultCode); faultCodeValue.setText(wste.getCode()); SOAPFaultValue faultSubCodeValue = fac.createSOAPFaultValue(faultSubCode); faultSubCodeValue.setText(wste.getSubCode());
fCode.setText(faultValue); } else { final SOAPFaultValue fValue = factory.createSOAPFaultValue(fCode); fValue.setText(faultValue);
public void addFaultSubcode(QName subcode) { SOAPFaultCode faultCode = getAxiomFault().getCode(); SOAPFaultSubCode faultSubCode = null; if (faultCode.getSubCode() == null) { faultSubCode = getAxiomFactory().createSOAPFaultSubCode(faultCode); } else { faultSubCode = faultCode.getSubCode(); while (true) { if (faultSubCode.getSubCode() != null) { faultSubCode = faultSubCode.getSubCode(); } else { faultSubCode = getAxiomFactory().createSOAPFaultSubCode(faultSubCode); break; } } } SOAPFaultValue faultValue = getAxiomFactory().createSOAPFaultValue(faultSubCode); setValueText(subcode, faultValue); }
@Override public void addFaultSubcode(QName subcode) { SOAPFaultCode faultCode = getAxiomFault().getCode(); SOAPFaultSubCode faultSubCode = null; if (faultCode.getSubCode() == null) { faultSubCode = getAxiomFactory().createSOAPFaultSubCode(faultCode); } else { faultSubCode = faultCode.getSubCode(); while (true) { if (faultSubCode.getSubCode() != null) { faultSubCode = faultSubCode.getSubCode(); } else { faultSubCode = getAxiomFactory().createSOAPFaultSubCode(faultSubCode); break; } } } SOAPFaultValue faultValue = getAxiomFactory().createSOAPFaultValue(faultSubCode); setValueText(subcode, faultValue); }
@Override public void addFaultSubcode(QName subcode) { SOAPFaultCode faultCode = getAxiomFault().getCode(); SOAPFaultSubCode faultSubCode = null; if (faultCode.getSubCode() == null) { faultSubCode = getAxiomFactory().createSOAPFaultSubCode(faultCode); } else { faultSubCode = faultCode.getSubCode(); while (true) { if (faultSubCode.getSubCode() != null) { faultSubCode = faultSubCode.getSubCode(); } else { faultSubCode = getAxiomFactory().createSOAPFaultSubCode(faultSubCode); break; } } } SOAPFaultValue faultValue = getAxiomFactory().createSOAPFaultValue(faultSubCode); setValueText(subcode, faultValue); }
SOAPFaultSubCode faultSubCode = factory.createSOAPFaultSubCode(faultCode); SOAPFaultValue faultColdValue = factory.createSOAPFaultValue(faultCode); SOAPFaultValue faultSubcodeValue = factory.createSOAPFaultValue(faultSubCode);
private SOAPFault addStandardFault(String localName, String faultStringOrReason, Locale locale) { Assert.notNull(faultStringOrReason, "No faultStringOrReason given"); try { AxiomUtils.removeContents(getAxiomBody()); SOAPFault fault = getAxiomFactory().createSOAPFault(getAxiomBody()); SOAPFaultCode code = getAxiomFactory().createSOAPFaultCode(fault); SOAPFaultValue value = getAxiomFactory().createSOAPFaultValue(code); value.setText(fault.getNamespace().getPrefix() + ":" + localName); SOAPFaultReason reason = getAxiomFactory().createSOAPFaultReason(fault); SOAPFaultText text = getAxiomFactory().createSOAPFaultText(reason); if (locale != null) { text.setLang(AxiomUtils.toLanguage(locale)); } text.setText(faultStringOrReason); return fault; } catch (SOAPProcessingException ex) { throw new AxiomSoapFaultException(ex); } }
private SOAPFault addStandardFault(String localName, String faultStringOrReason, Locale locale) { Assert.notNull(faultStringOrReason, "No faultStringOrReason given"); try { AxiomUtils.removeContents(getAxiomBody()); SOAPFault fault = getAxiomFactory().createSOAPFault(getAxiomBody()); SOAPFaultCode code = getAxiomFactory().createSOAPFaultCode(fault); SOAPFaultValue value = getAxiomFactory().createSOAPFaultValue(code); value.setText(fault.getNamespace().getPrefix() + ":" + localName); SOAPFaultReason reason = getAxiomFactory().createSOAPFaultReason(fault); SOAPFaultText text = getAxiomFactory().createSOAPFaultText(reason); if (locale != null) { text.setLang(AxiomUtils.toLanguage(locale)); } text.setText(faultStringOrReason); return fault; } catch (SOAPProcessingException ex) { throw new AxiomSoapFaultException(ex); } }
private SOAPFault addStandardFault(String localName, String faultStringOrReason, Locale locale) { Assert.notNull(faultStringOrReason, "No faultStringOrReason given"); try { AxiomUtils.removeContents(getAxiomBody()); SOAPFault fault = getAxiomFactory().createSOAPFault(getAxiomBody()); SOAPFaultCode code = getAxiomFactory().createSOAPFaultCode(fault); SOAPFaultValue value = getAxiomFactory().createSOAPFaultValue(code); value.setText(fault.getNamespace().getPrefix() + ":" + localName); SOAPFaultReason reason = getAxiomFactory().createSOAPFaultReason(fault); SOAPFaultText text = getAxiomFactory().createSOAPFaultText(reason); if (locale != null) { text.setLang(AxiomUtils.toLanguage(locale)); } text.setText(faultStringOrReason); return fault; } catch (SOAPProcessingException ex) { throw new AxiomSoapFaultException(ex); } }
@Override public void addFaultSubcode(QName subcode) { SOAPFaultCode faultCode = getAxiomFault().getCode(); SOAPFaultSubCode faultSubCode = null; if (faultCode.getSubCode() == null) { faultSubCode = getAxiomFactory().createSOAPFaultSubCode(faultCode); } else { faultSubCode = faultCode.getSubCode(); while (true) { if (faultSubCode.getSubCode() != null) { faultSubCode = faultSubCode.getSubCode(); } else { faultSubCode = getAxiomFactory().createSOAPFaultSubCode(faultSubCode); break; } } } SOAPFaultValue faultValue = getAxiomFactory().createSOAPFaultValue(faultSubCode); setValueText(subcode, faultValue); }
soapFactory = (SOAPFactory)this.omTarget.getOMFactory(); soapFaultCode = soapFactory.createSOAPFaultCode(omTarget); SOAPFaultValue soapFaultValue = soapFactory.createSOAPFaultValue(soapFaultCode); soapFaultCode.setValue(soapFaultValue); soapFaultValue.setText(faultCode);
private SOAPFault addStandardFault(String localName, String faultStringOrReason, Locale locale) { Assert.notNull(faultStringOrReason, "No faultStringOrReason given"); try { AxiomUtils.removeContents(getAxiomBody()); SOAPFault fault = getAxiomFactory().createSOAPFault(getAxiomBody()); SOAPFaultCode code = getAxiomFactory().createSOAPFaultCode(fault); SOAPFaultValue value = getAxiomFactory().createSOAPFaultValue(code); value.setText(fault.getNamespace().getPrefix() + ":" + localName); SOAPFaultReason reason = getAxiomFactory().createSOAPFaultReason(fault); SOAPFaultText text = getAxiomFactory().createSOAPFaultText(reason); if (locale != null) { text.setLang(AxiomUtils.toLanguage(locale)); } text.setText(faultStringOrReason); return fault; } catch (SOAPProcessingException ex) { throw new AxiomSoapFaultException(ex); } }