public String getFaultActor() { if (this.omTarget.getRole() != null) { return this.omTarget.getRole().getRoleValue(); } return null; }
private void setFaultRole(SOAPFactory factory, SOAPFault fault) { if (faultRole != null) { SOAPFaultRole soapFaultRole = factory.createSOAPFaultRole(); soapFaultRole.setRoleValue(faultRole.toString()); fault.setRole(soapFaultRole); } }
soapFaultRole.setRoleValue(fault.getRole().getRoleValue()); newFault.setRole(soapFaultRole);
|| org.apache.axis2.namespace.Constants.QNAME_FAULTSTRING.equals(element.getQName())) { if (!roleFound) { soapFaultRole.setText(element.getText()); roleFound = true; } else {
/** * Returns the optional Role element value for this SOAPFault object. The Role element is * optional in SOAP 1.2. * * @return Content of the env:Fault/env:Role element as a String or null if none * @throws UnsupportedOperationException * - if this message does not support the SOAP 1.2 concept of Fault Role. * @since SAAJ 1.3 */ public String getFaultRole() { if (((SOAPFactory)this.omTarget.getOMFactory()).getSOAPVersion() == SOAPVersion.SOAP11) { throw new UnsupportedOperationException("Message does not support the " + "SOAP 1.2 concept of Fault Reason"); } else { if (this.omTarget.getRole() != null) { return this.omTarget.getRole().getText(); } else { return null; } } }
(faultRole).serialize(writer);
fault.getRole().setText((String) faultRole); } else if (axisFault != null) { if (axisFault.getFaultRoleElement() != null) {
/** * Returns the optional Role element value for this SOAPFault object. The Role element is * optional in SOAP 1.2. * * @return Content of the env:Fault/env:Role element as a String or null if none * @throws UnsupportedOperationException * - if this message does not support the SOAP 1.2 concept of Fault Role. * @since SAAJ 1.3 */ public String getFaultRole() { if (((SOAPFactory)this.omTarget.getOMFactory()).getSOAPVersion() == SOAP11Version.getSingleton()) { throw new UnsupportedOperationException("Message does not support the " + "SOAP 1.2 concept of Fault Reason"); } else { if (this.omTarget.getRole() != null) { return this.omTarget.getRole().getText(); } else { return null; } } }
@Override public String getFaultActorOrRole() { SOAPFaultRole faultRole = getAxiomFault().getRole(); return faultRole != null ? faultRole.getRoleValue() : null; }
private void setFaultRole(SOAPFactory factory, SOAPFault fault) { if (faultRole != null) { SOAPFaultRole soapFaultRole = factory.createSOAPFaultRole(); soapFaultRole.setRoleValue(faultRole.toString()); fault.setRole(soapFaultRole); } }
fault.getRole().setText((String) faultRole); } else if (axisFault != null) { if (axisFault.getFaultRoleElement() != null) {
@Override public String getFaultActorOrRole() { SOAPFaultRole faultRole = getAxiomFault().getRole(); return faultRole != null ? faultRole.getRoleValue() : null; }
/** * Sets this SOAPFault object with the given fault actor.The fault actor is the recipient in the * message path who caused the fault to happen. If this SOAPFault supports SOAP 1.2 then this * call is equivalent to setFaultRole(String) * * @param faultActor - a String identifying the actor that caused this SOAPFault object * @throws SOAPException - if there was an error in adding the faultActor to the underlying XML * tree. */ public void setFaultActor(String faultActor) throws SOAPException { if (this.omTarget.getRole() == null) { SOAPFaultRole faultRoleImpl = ((SOAPFactory)this.omTarget.getOMFactory()).createSOAPFaultRole( this.omTarget); faultRoleImpl.setRoleValue(faultActor); this.omTarget.setRole(faultRoleImpl); } else { SOAPFaultRole role = this.omTarget.getRole(); role.setRoleValue(faultActor); } }
public String getFaultActor() { if (this.omTarget.getRole() != null) { return this.omTarget.getRole().getRoleValue(); } return null; }
/** * Sets this SOAPFault object with the given fault actor.The fault actor is the recipient in the * message path who caused the fault to happen. If this SOAPFault supports SOAP 1.2 then this * call is equivalent to setFaultRole(String) * * @param faultActor - a String identifying the actor that caused this SOAPFault object * @throws SOAPException - if there was an error in adding the faultActor to the underlying XML * tree. */ public void setFaultActor(String faultActor) throws SOAPException { if (this.omTarget.getRole() == null) { SOAPFaultRole faultRoleImpl = ((SOAPFactory)this.omTarget.getOMFactory()).createSOAPFaultRole( this.omTarget); faultRoleImpl.setRoleValue(faultActor); this.omTarget.setRole(faultRoleImpl); } else { SOAPFaultRole role = this.omTarget.getRole(); role.setRoleValue(faultActor); } }
@Override public String getFaultActorOrRole() { SOAPFaultRole faultRole = getAxiomFault().getRole(); return faultRole != null ? faultRole.getRoleValue() : null; }
@Override public void setFaultActorOrRole(String actor) { try { SOAPFaultRole axiomFaultRole = getAxiomFactory().createSOAPFaultRole(getAxiomFault()); axiomFaultRole.setRoleValue(actor); } catch (SOAPProcessingException ex) { throw new AxiomSoapFaultException(ex); } }
public String getFaultActorOrRole() { SOAPFaultRole faultRole = getAxiomFault().getRole(); return faultRole != null ? faultRole.getRoleValue() : null; }
@Override public void setFaultActorOrRole(String actor) { try { SOAPFaultRole axiomFaultRole = getAxiomFactory().createSOAPFaultRole(getAxiomFault()); axiomFaultRole.setRoleValue(actor); } catch (SOAPProcessingException ex) { throw new AxiomSoapFaultException(ex); } }
public void testSOAP11Fault() throws Exception { FaultMediator faultMediator = new FaultMediator(); faultMediator.setSoapVersion(FaultMediator.SOAP11); faultMediator.setFaultCodeValue(F_CODE); faultMediator.setFaultReasonValue(F_STRING); faultMediator.setFaultRole(new URI(F_ACTOR_URI)); faultMediator.setFaultDetail(F_DETAIL); // invoke transformation, with static enveope MessageContext synCtx = TestUtils.getAxis2MessageContext( "<empty/>", new HashMap<String, Entry>()); faultMediator.mediate(synCtx); SOAPEnvelope envelope = synCtx.getEnvelope(); SOAPFault fault = envelope.getBody().getFault(); assertTrue(F_CODE.equals(fault.getCode().getTextAsQName())); assertTrue(F_STRING.equals(fault.getReason().getText())); assertTrue(F_ACTOR_URI.equals(fault.getRole().getRoleValue())); assertTrue(F_DETAIL.equals(fault.getDetail().getText())); assertEquals(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI, envelope.getNamespace().getNamespaceURI()); } }