/** * Return the wrapped JAX-WS SOAPFault. */ public final SOAPFault getFault() { return ((SOAPFaultException) getCause()).getFault(); }
/** * Return the wrapped JAX-WS SOAPFault. */ public final SOAPFault getFault() { return ((SOAPFaultException) getCause()).getFault(); }
@Override protected Fault createFault(Throwable ex, Method m, List<Object> params, boolean checked) { //map the JAX-WS faults SOAPFaultException sfe = findSoapFaultException(ex); if (sfe != null) { SoapFault fault = new SoapFault(sfe.getFault().getFaultString(), ex, sfe.getFault().getFaultCodeAsQName()); fault.setRole(sfe.getFault().getFaultActor()); if (sfe.getFault().hasDetail()) { fault.setDetail(sfe.getFault().getDetail()); } return fault; } return super.createFault(ex, m, params, checked); }
soapFault.setFaultString(sf.getFault().getFaultString()); SAAJUtils.setFaultCode(soapFault, sf.getFault().getFaultCodeAsQName()); soapFault.setFaultActor(sf.getFault().getFaultActor()); if (sf.getFault().hasDetail()) { Node nd = soapMessage.getSOAPPart().importNode(sf.getFault().getDetail(), true); nd = nd.getFirstChild();
if (soapVersion != null && soapVersion.getVersion() != 1.1) { if (f instanceof SoapFault) { for (Iterator<QName> it = CastUtils.cast(sf.getFault().getFaultSubcodes()); it.hasNext();) { ((SoapFault) f).addSubCode(it.next()); if (sf.getFault().getFaultReasonLocales().hasNext()) { Locale lang = (Locale) sf.getFault() .getFaultReasonLocales().next(); String convertedLang = lang.getLanguage();
try{ if (tokenIsExpired()){ renewToken(); } client.sendData(data, this.token); }catch(SOAPFaultException e){ if(e.getFault().getFaultString().equalsIgnoreCase("Token expired") ) { renewToken(); client.sendData(data, this.token); } ...... }
soapFault.setFaultString(sf.getFault().getFaultString()); SAAJUtils.setFaultCode(soapFault, sf.getFault().getFaultCodeAsQName()); soapFault.setFaultActor(sf.getFault().getFaultActor()); if (sf.getFault().hasDetail()) { Node nd = originalMsg.getSOAPPart().importNode( sf.getFault().getDetail() .getFirstChild(), true); soapFault.addDetail().appendChild(nd);
/** * Return the wrapped JAX-WS SOAPFault. */ public final SOAPFault getFault() { return ((SOAPFaultException) getCause()).getFault(); }
/** * Return the wrapped JAX-WS SOAPFault. */ public final SOAPFault getFault() { return ((SOAPFaultException) getCause()).getFault(); }
private boolean isFileNotFound(SOAPFaultException e) { Detail detail = e.getFault().getDetail(); NodeList childNodes = detail.getChildNodes(); for (int i = 0; i < childNodes.getLength(); ++i) { // I hate soap... if (childNodes.item(i).getNodeName().equals("FileNotFoundFault")) { return true; } } return false; }
try { //... invoke service via client } catch (javax.xml.ws.soap.SOAPFaultException soapFaultException) { javax.xml.soap.SOAPFault fault = soapFaultException.getFault(); //<Fault> node javax.xml.soap.Detail detail = fault.getDetail(); // <detail> node Iterator detailEntries = detail.getDetailEntries(); //nodes under <detail> //application / service-provider-specific XML nodes (type javax.xml.soap.DetailEntry) from here }
public static DispositionReportFaultMessage MapException(SOAPFaultException ex) { org.uddi.api_v3.DispositionReport r = new org.uddi.api_v3.DispositionReport(); r.setTruncated(false); r.getResult().addAll(MapFault(ex.getFault())); DispositionReportFaultMessage x = new DispositionReportFaultMessage(ex.getMessage(), r); return x; }
private void setFault(Message msg, SOAPFaultException e) { SOAPFault fault = e.getFault(); Detail detail = fault.getDetail(); if (detail != null) { for (Iterator i = detail.getDetailEntries(); i.hasNext();) { DetailEntry entry = (DetailEntry)i.next(); FaultException fe = new FaultException(e.getMessage(), entry, e); fe.setFaultName(entry.getElementQName()); msg.setFaultBody(fe); } } else { msg.setFaultBody(e); } }
public static SoapFault11 create(SOAPFaultException sfe) { try { SOAPFault cause = sfe.getFault(); QName faultCode = cause.getFaultCodeAsQName(); String reason = cause.getFaultString(); SoapFaultType soapFaultType = SoapFaultType.toState(reason); Detail detail = cause.getDetail(); return new SoapFault11(soapFaultType, faultCode, null, detail); } catch (InvalidEnumerationException e) { return new SoapFault11(e); } } /**
public static SoapFault11 create(SOAPFaultException sfe) { try { SOAPFault cause = sfe.getFault(); QName faultCode = cause.getFaultCodeAsQName(); String reason = cause.getFaultString(); SoapFaultType soapFaultType = SoapFaultType.toState(reason); Detail detail = cause.getDetail(); return new SoapFault11(soapFaultType, faultCode, null, detail); } catch (InvalidEnumerationException e) { return new SoapFault11(e); } } /**
public static SoapFault11 create(SOAPFaultException sfe) { try { SOAPFault cause = sfe.getFault(); QName faultCode = cause.getFaultCodeAsQName(); String reason = cause.getFaultString(); SoapFaultType soapFaultType = SoapFaultType.toState(reason); Detail detail = cause.getDetail(); return new SoapFault11(soapFaultType, faultCode, null, detail); } catch (InvalidEnumerationException e) { return new SoapFault11(e); } } /**
public static SoapFault11 create(SOAPFaultException sfe) { try { SOAPFault cause = sfe.getFault(); QName faultCode = cause.getFaultCodeAsQName(); String reason = cause.getFaultString(); SoapFaultType soapFaultType = SoapFaultType.toState(reason); Detail detail = cause.getDetail(); return new SoapFault11(soapFaultType, faultCode, null, detail); } catch (InvalidEnumerationException e) { return new SoapFault11(e); } } /**
@Test public void testAnonToNonAnon() throws Exception { try (AddNumbersPortTypeProxy port = getPort()) { port.getRequestContext() .put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "http://localhost:" + PORT + "/jaxws/addNonAnon"); try { port.addNumbers3(-1, 2); } catch (SOAPFaultException e) { assertTrue(e.getFault().getFaultCode().contains("OnlyNonAnonymousAddressSupported")); } } } @Test