XPathUtils xu = new XPathUtils(ns); ns.put("s", Fault.STACKTRACE_NAMESPACE); String ss = (String) xu.getValue("//s:" + Fault.STACKTRACE + "/text()", fault.getDetail(), XPathConstants.STRING); List<StackTraceElement> stackTraceList = new ArrayList<StackTraceElement>();
XPathUtils xu = new XPathUtils(ns); ns.put("s", Fault.STACKTRACE_NAMESPACE); String ss = (String) xu.getValue("//s:" + Fault.STACKTRACE + "/text()", fault.getDetail(), XPathConstants.STRING); List<StackTraceElement> stackTraceList = new ArrayList<>();
XPathUtils xu = new XPathUtils(ns); ns.put("s", Fault.STACKTRACE_NAMESPACE); String ss = (String) xu.getValue("//s:" + Fault.STACKTRACE + "/text()", fault.getDetail(), XPathConstants.STRING); List<StackTraceElement> stackTraceList = new ArrayList<StackTraceElement>();
XPathUtils xu = new XPathUtils(ns); ns.put("s", Fault.STACKTRACE_NAMESPACE); String ss = (String) xu.getValue("//s:" + Fault.STACKTRACE + "/text()", fault.getDetail(), XPathConstants.STRING); List<StackTraceElement> stackTraceList = new ArrayList<>();
protected void processFaultDetail(Fault fault, Message msg) { if (fault.getDetail() == null) { return; } Element exDetail = (Element) DOMUtils.getChild(fault.getDetail(), Node.ELEMENT_NODE); if (exDetail == null) { return; } QName qname = new QName(exDetail.getNamespaceURI(), exDetail .getLocalName()); faultWanted = null; BindingOperationInfo boi = msg.getExchange().get( BindingOperationInfo.class); if (boi.isUnwrapped()) { boi = boi.getWrappedOperation(); } for (BindingFaultInfo bfi : boi.getFaults()) { for (MessagePartInfo mpi : bfi.getFaultInfo().getMessageParts()) { if (qname.equals(mpi.getConcreteName())) { faultWanted = bfi; msg.put(BindingFaultInfo.class, faultWanted); break; } } if (faultWanted != null) { break; } } }
public static XMLFault createFault(Fault f) { if (f instanceof XMLFault) { return (XMLFault) f; } Throwable th = f.getCause(); XMLFault xmlFault = new XMLFault(new Message(f.getMessage(), (ResourceBundle) null), th); xmlFault.setDetail(f.getDetail()); return xmlFault; }
public static JBIFault createFault(Fault f) { if (f instanceof JBIFault) { return (JBIFault) f; } Throwable th = f.getCause(); JBIFault jbiFault = new JBIFault(new Message(f.getMessage(), (ResourceBundle) null), th); jbiFault.setDetail(f.getDetail()); return jbiFault; }
public static NMRFault createFault(Fault f) { if (f instanceof NMRFault) { return (NMRFault) f; } Throwable th = f.getCause(); NMRFault jbiFault = new NMRFault(new Message(f.getMessage(), (ResourceBundle) null), th); jbiFault.setDetail(f.getDetail()); return jbiFault; }
public static JbiFault createFault(Fault f) { if (f instanceof JbiFault) { return (JbiFault) f; } Throwable th = f.getCause(); JbiFault jbiFault = new JbiFault(new Message(f.getMessage(), (ResourceBundle) null), th); jbiFault.setDetail(f.getDetail()); return jbiFault; }
public static XMLFault createFault(Fault f) { if (f instanceof XMLFault) { return (XMLFault) f; } Throwable th = f.getCause(); XMLFault xmlFault = new XMLFault(new Message(f.getMessage(), (ResourceBundle) null), th); xmlFault.setDetail(f.getDetail()); return xmlFault; }
public void handleMessage(Message msg) { Fault fault = (Fault) msg.getContent(Exception.class); if (fault.getDetail() != null && !MessageUtils.getContextualBoolean(msg, DISABLE_FAULT_MAPPING, false)) { processFaultDetail(fault, msg); setStackTrace(fault, msg); } FaultMode faultMode = FaultMode.UNCHECKED_APPLICATION_FAULT; // Check if the raised exception is declared in the WSDL or by the JAX-RS resource Method m = msg.getExchange().get(Method.class); if (m != null) { Exception e = msg.getContent(Exception.class); for (Class<?> cl : m.getExceptionTypes()) { if (cl.isInstance(e)) { faultMode = FaultMode.CHECKED_APPLICATION_FAULT; break; } } } msg.getExchange().put(FaultMode.class, faultMode); }
public void handleMessage(Message msg) { Fault fault = (Fault) msg.getContent(Exception.class); if (fault.getDetail() != null && !MessageUtils.getContextualBoolean(msg, DISABLE_FAULT_MAPPING, false)) { processFaultDetail(fault, msg); setStackTrace(fault, msg); } FaultMode faultMode = FaultMode.UNCHECKED_APPLICATION_FAULT; // Check if the raised exception is declared in the WSDL or by the JAX-RS resource Method m = msg.getExchange().get(Method.class); if (m != null) { Exception e = msg.getContent(Exception.class); for (Class<?> cl : m.getExceptionTypes()) { if (cl.isInstance(e)) { faultMode = FaultMode.CHECKED_APPLICATION_FAULT; break; } } } msg.getExchange().put(FaultMode.class, faultMode); }
public void handleMessage(Message msg) { Fault fault = (Fault) msg.getContent(Exception.class); if (fault.getDetail() != null && !MessageUtils.getContextualBoolean(msg, DISABLE_FAULT_MAPPING, false)) { processFaultDetail(fault, msg); setStackTrace(fault, msg); } FaultMode faultMode = FaultMode.UNCHECKED_APPLICATION_FAULT; // Check if the raised exception is declared in the WSDL or by the JAX-RS resource Method m = msg.getExchange().get(Method.class); if (m != null) { Exception e = msg.getContent(Exception.class); for (Class<?> cl : m.getExceptionTypes()) { if (cl.isInstance(e)) { faultMode = FaultMode.CHECKED_APPLICATION_FAULT; break; } } } msg.getExchange().put(FaultMode.class, faultMode); }
public void handleMessage(Message msg) { Fault fault = (Fault) msg.getContent(Exception.class); if (fault.getDetail() != null && !MessageUtils.getContextualBoolean(msg, DISABLE_FAULT_MAPPING, false)) { processFaultDetail(fault, msg); setStackTrace(fault, msg); } FaultMode faultMode = FaultMode.UNCHECKED_APPLICATION_FAULT; // Check if the raised exception is declared in the WSDL or by the JAX-RS resource Method m = msg.getExchange().get(Method.class); if (m != null) { Exception e = msg.getContent(Exception.class); for (Class<?> cl : m.getExceptionTypes()) { if (cl.isInstance(e)) { faultMode = FaultMode.CHECKED_APPLICATION_FAULT; break; } } } msg.getExchange().put(FaultMode.class, faultMode); }
updateSoap12FaultCodes(soapFault); soapFault.setDetail(f.getDetail()); return soapFault;
updateSoap12FaultCodes(soapFault); soapFault.setDetail(f.getDetail()); return soapFault;
if (mpi != null) { Fault fault = (Fault) message.getContent(Exception.class); Element detail = fault.getDetail(); if (detail != null && detail.getFirstChild().getLocalName().equals(mpi.getName().getLocalPart())) {
private Object[] invoke(SoapRequest request, Exchange exchange, MessageDispatcher dispatcher) { String operation = request.getOperation(); XMLStreamReader xmlBody = getXmlBody(request); try { Map<String, Object> ctx = getInvocationContext(request, dispatcher); return client.invoke(getInvocationOperation(), new Object[] {xmlBody}, ctx, exchange); } catch (SoapFault sf) { throw new SoapFaultException(sf.getFaultCode(), sf.getSubCode(), parseExceptionDetail(sf.getDetail()).orElse(null), sf.getReason(), sf.getNode(), sf.getRole(), sf); } catch (Fault f) { if (f.getMessage().contains("COULD_NOT_READ_XML")) { throw new BadRequestException("Error consuming the operation [" + operation + "], the request body is not a valid XML"); } throw new SoapFaultException(f.getFaultCode(), parseExceptionDetail(f.getDetail()).orElse(null), f); } catch (DispatchingException e) { throw e; } catch (OperationNotFoundException e) { String location = wsdlModel.getLocation(); throw new BadRequestException("The provided [" + operation + "] does not exist in the WSDL file [" + location + "]", e); } catch (Exception e) { throw new SoapServiceException("Unexpected error while consuming the web service operation [" + operation + "]", e); } }