/** Returns true if this SOAPFault has a Detail subelement and false otherwise. */ public boolean hasDetail() { if (this.omTarget.getDetail() != null) { return true; } else { return false; } }
/** Returns true if this SOAPFault has a Detail subelement and false otherwise. */ public boolean hasDetail() { if (this.omTarget.getDetail() != null) { return true; } else { return false; } }
private static Fault inferFault(Operation operation, SOAPFault flt) { if (flt.getDetail() == null) { return null; } if (flt.getDetail().getFirstElement() == null) { return null; } // The detail is a dummy <detail> node containing the interesting fault element QName elName = flt.getDetail().getFirstElement().getQName(); return WsdlUtils.inferFault(operation, elName); }
public Detail getDetail() { return (Detail)toSAAJNode((org.w3c.dom.Node)omTarget.getDetail()); }
public Detail getDetail() { return (Detail)toSAAJNode((org.w3c.dom.Node)omTarget.getDetail()); }
public static Fault parseSoapFault(Element odeMsgEl, SOAPEnvelope envelope, Operation operation) throws AxisFault { SOAPFault flt = envelope.getBody().getFault(); SOAPFaultDetail detail = flt.getDetail(); Fault fdef = inferFault(operation, flt); if (fdef == null) { return null; } Part pdef = (Part) fdef.getMessage().getParts().values().iterator().next(); Element partel = odeMsgEl.getOwnerDocument().createElementNS(null, pdef.getName()); odeMsgEl.appendChild(partel); if (detail.getFirstChildWithName(pdef.getElementName()) != null) { partel.appendChild(odeMsgEl.getOwnerDocument().importNode( OMUtils.toDOM(detail.getFirstChildWithName(pdef.getElementName())), true)); } else { partel.appendChild(odeMsgEl.getOwnerDocument().importNode(OMUtils.toDOM(detail), true)); } return fdef; }
private static AxisFault getAxisFaultFromFromSOAPFault(SOAPFault faultPart, RMMsgContext rmMsgCtx) { String soapFaultSubcode = null; SequenceFault sequenceFault = rmMsgCtx.getSequenceFault(); AxisFault axisFault = null; // If the sequence fault part is not null, then we have an RM specific fault. if (sequenceFault != null) { soapFaultSubcode = sequenceFault.getFaultCode().getFaultCode().getLocalPart(); //Need to concatenate all info about the error into string StringBuffer faultSB = new StringBuffer(); faultSB.append(soapFaultSubcode + " "); faultSB.append(sequenceFault.getFaultCode().getDetail() + " "); faultSB.append(faultPart.getDetail().getText()); axisFault = new AxisFault(faultSB.toString(), sequenceFault.getFaultCode().getFaultCode()); } else { axisFault = new AxisFault(faultPart.getCode(), faultPart.getReason(), faultPart.getNode(), faultPart .getRole(), faultPart.getDetail()); } return axisFault; }
SOAPFaultDetail soapFaultDetail = fault.getDetail(); if (soapFaultDetail != null) { omElement = soapFaultDetail.getFirstElement();
@Override public SoapFaultDetail getFaultDetail() { try { SOAPFaultDetail axiomFaultDetail = getAxiomFault().getDetail(); return axiomFaultDetail != null ? new AxiomSoapFaultDetail(axiomFaultDetail, getAxiomFactory()) : null; } catch (OMException ex) { throw new AxiomSoapFaultException(ex); } }
@Override public SoapFaultDetail getFaultDetail() { try { SOAPFaultDetail axiomFaultDetail = getAxiomFault().getDetail(); return axiomFaultDetail != null ? new AxiomSoapFaultDetail(axiomFaultDetail, getAxiomFactory()) : null; } catch (OMException ex) { throw new AxiomSoapFaultException(ex); } }
public SoapFaultDetail getFaultDetail() { try { SOAPFaultDetail axiomFaultDetail = getAxiomFault().getDetail(); return axiomFaultDetail != null ? new AxiomSoapFaultDetail(axiomFaultDetail, getAxiomFactory()) : null; } catch (OMException ex) { throw new AxiomSoapFaultException(ex); } }
@Override public SoapFaultDetail getFaultDetail() { try { SOAPFaultDetail axiomFaultDetail = getAxiomFault().getDetail(); return axiomFaultDetail != null ? new AxiomSoapFaultDetail(axiomFaultDetail, getAxiomFactory()) : null; } catch (OMException ex) { throw new AxiomSoapFaultException(ex); } }
SOAPFaultDetail soapFaultDetail = fault.getDetail(); if (soapFaultDetail != null) { omElement = soapFaultDetail.getFirstElement();
private void initializeValues(SOAPFault fault) { if (fault != null) { initializeValues(fault.getCode(), fault.getReason(), fault.getNode(), fault.getRole(), fault.getDetail()); } }
private void initializeValues(SOAPFault fault) { if (fault != null) { initializeValues(fault.getCode(), fault.getReason(), fault.getNode(), fault.getRole(), fault.getDetail()); } }
private void processFaultsInfoIfPresent() { OMElement detailElement = AddressingFaultsHelper .getDetailElementForAddressingFault(messageContext, addressingNamespaceObject); if (detailElement != null) { //The difference between SOAP 1.1 and SOAP 1.2 fault messages is explained in the WS-Addressing Specs. if (isFinalAddressingNamespace && messageContext.isSOAP11()) { // Add detail as a wsa:FaultDetail header if (!isAddressingHeaderAlreadyAvailable(Final.FAULT_HEADER_DETAIL, false)) { SOAPHeaderBlock faultDetail = header.addHeaderBlock( Final.FAULT_HEADER_DETAIL, addressingNamespaceObject); faultDetail.addChild((OMElement)factory.importInformationItem(detailElement)); } } else if (!messageContext.isSOAP11()) { // Add detail to the Fault in the SOAP Body SOAPFault fault = envelope.getBody().getFault(); if (fault != null && fault.getDetail() != null) { fault.getDetail().addDetailEntry( (OMElement)factory.importInformationItem(detailElement)); } } } }
/** * Building the envelope with SOAP 1.1 * * @param faultMsgContext * @param data * @throws SandeshaException */ private static void doSOAP11Encoding(MessageContext faultMsgContext, FaultData data, String rmNamespaceValue) throws SandeshaException { SOAPEnvelope faultMsgEnvelope = faultMsgContext.getEnvelope(); if (faultMsgEnvelope == null) throw new SandeshaException(SandeshaMessageHelper.getMessage( SandeshaMessageKeys.soapEnvNotSet)); SOAPFactory factory = SOAPAbstractFactory.getSOAPFactory(SandeshaUtil .getSOAPVersion(faultMsgEnvelope)); SOAPFault fault = faultMsgEnvelope.getBody().getFault(); SOAPFaultCode code = fault.getCode(); if (data.getCode()!=null) { code.setText(data.getCode()); } if (data.getExceptionString() != null) fault.getDetail().setText(data.getExceptionString()); //SequenceFault header is added only for SOAP 1.1 if (isSequenceFault(data)) addSequenceFaultHeader(faultMsgContext, data, factory, rmNamespaceValue); }
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()); } }