public String getReason() { return getMessage(); }
public String getReason() { return getMessage(); }
SoapObject response = null; if (envelope.bodyIn instanceof SoapObject) { // SoapObject = SUCCESS response = (SoapObject) envelope.bodyIn; } else if (envelope.bodyIn instanceof SoapFault) { // SoapFault = // FAILURE SoapFault soapFault = (SoapFault) envelope.bodyIn; throw new Exception(soapFault.getMessage()); }
private class Login extends AsyncTask<Void, Integer, String> { @Override protected void onPreExecute() { } @Override protected void onPostExecute(String result) { } @Override protected String doInBackground(Void... params) { try { // Soap Call } catch (SoapFault fault) { Log.v("TAG", "soapfault = "+fault.getMessage()); } catch (Exception e) { e.printStackTrace(); } return null; } }
System.out.println("Got exception: " + af.getClass().getName()); System.out.println("Reason = " + af.getReason()); System.out.println("Message = " + af.getMessage()); fail("Legal access dis-allowed"); } else {
System.out.println("Got exception: " + af.getClass().getName()); System.out.println("Reason = " + af.getReason()); System.out.println("Message = " + af.getMessage()); fail("Legal access dis-allowed"); } else {
static String getFaultMessage(SoapMessage message, SoapFault fault) { if (message.get("forced.faultstring") != null) { return (String) message.get("forced.faultstring"); } boolean config = MessageUtils.getContextualBoolean(message, Message.EXCEPTION_MESSAGE_CAUSE_ENABLED, false); if (fault.getMessage() != null) { if (config && fault.getCause() != null && fault.getCause().getMessage() != null && !fault.getMessage().equals(fault.getCause().getMessage())) { return fault.getMessage() + " Caused by: " + fault.getCause().getMessage(); } return fault.getMessage(); } else if (config && fault.getCause() != null) { if (fault.getCause().getMessage() != null) { return fault.getCause().getMessage(); } return fault.getCause().toString(); } else { return "Fault occurred while processing."; } } }
static String getFaultMessage(SoapMessage message, SoapFault fault) { if (message.get("forced.faultstring") != null) { return (String) message.get("forced.faultstring"); } boolean config = MessageUtils.getContextualBoolean(message, Message.EXCEPTION_MESSAGE_CAUSE_ENABLED, false); if (fault.getMessage() != null) { if (config && fault.getCause() != null && fault.getCause().getMessage() != null && !fault.getMessage().equals(fault.getCause().getMessage())) { return fault.getMessage() + " Caused by: " + fault.getCause().getMessage(); } return fault.getMessage(); } else if (config && fault.getCause() != null) { if (fault.getCause().getMessage() != null) { return fault.getCause().getMessage(); } return fault.getCause().toString(); } else { return "Fault occurred while processing."; } } }
sp.getMessage(); System.out.println("error = " + sp.getMessage());
public SoapFaultException(MuleEvent event, SoapFault soapFault, MessageProcessor failingMessageProcessor) { super(CoreMessages.createStaticMessage(soapFault.getMessage()), event, soapFault, failingMessageProcessor); this.faultCode = soapFault.getFaultCode(); this.subCode = soapFault.getSubCode(); this.detail = soapFault.getDetail(); }
faultMessageValidator = new PlainTextTestResource(expectedValue.getMessage()); codeValidator = new QNameValidator(expectedValue.getFaultCode()); if (expectedValue.getDetail() != null) faultMessageExchange.getIn().setBody(fault.getMessage()); validMessage = faultMessageValidator.matches(faultMessageExchange);
rpToken = sts.requestSecurityTokenResponse(realm); } catch (SoapFault ex) { LOG.error("Error in retrieving a token", ex.getMessage()); if (ex.getFaultCode() != null && "RequestFailed".equals(ex.getFaultCode().getLocalPart())) { throw new ProcessingException(TYPE.BAD_REQUEST);
assertEquals("Server", sf.getFaultCode().getLocalPart()); String text = sf.getMessage(); assertTrue(text.contains("{http://cxf.apache.org/transports/http/configuration}server"));