Examples of SoapFault


Examples of org.jibx.ws.soap.SoapFault

     * @throws SoapFaultException if server fault occurs
     */
    public Welcome welcomeService(Greetee greetee) throws WsException {
        char firstChar = greetee.getName().charAt(0);
        if (firstChar != 'z' && firstChar != 'Z') {
            SoapFault fault = createFaultFor(greetee);
            throw new SoapFaultException(fault);
        }
        return new Welcome("Howdy " + greetee.getName() + "!");
    }
View Full Code Here

Examples of org.jibx.ws.soap.SoapFault

     * @param greetee
     * @return custom SOAP fault
     * @throws WsException on error creating SOAP Fault
     */
    private SoapFault createFaultFor(Greetee greetee) throws WsException {
        SoapFault fault = new SoapFault(SoapFault.FAULT_CODE_SERVER, "ZorroFault in welcomeService",
            "http://example.ws.jibx.org/someactor");
        ZorroFault zorroFault = new ZorroFault(greetee.getName());
        fault.addDetailWriter(new MarshallingOutHandler(zorroFault));
        return fault;
    }
View Full Code Here

Examples of org.jibx.ws.soap.SoapFault

                    e = wrapped;
                }
            }
   
            SoapProcessor soapProcessor = ((SoapProcessor) processor);
            SoapFault fault;
            if (e instanceof SoapFaultException) {
                fault = ((SoapFaultException) e).getFault();
            } else if (e instanceof WsNotUnderstoodException) {
                fault = new SoapFault(SoapFault.FAULT_CODE_MUST_UNDERSTAND, e.getMessage(), null);
            } else {
                fault = new SoapFault(SoapFault.FAULT_CODE_SERVER, e.getMessage(), null);
                if (m_includeStackTrace) {
                    fault.addDetailWriter(new ExceptionWriter(e, m_includeStackTrace));
                }
            }
            soapProcessor.sendFaultMessage(fault, outConn);
        } catch (Throwable ex) {
            logger.error("Error while processing prior error", ex);
View Full Code Here

Examples of org.megatome.frame2.util.soap.SOAPFault

   * TranslationException { Element marshalledResult =
   * marshallResponse(context.getRequestAttribute(key)); return
   * marshalledResult; }
   */
  private Element createFault(Throwable e) {
    SOAPFault fault = new SOAPFault();

    fault.setDetailMessage(e.getMessage(), true);

    Element elem = null;

    try {
      elem = fault.getElement();
    } catch (SOAPException se) {
      // NIT maybe not catch, shouldn't happen.
    }

    return elem;
View Full Code Here

Examples of org.megatome.frame2.util.soap.SOAPFault

    return elem;
  }

  private Element createFault(Errors errs) throws SOAPException {
    SOAPFault fault = new SOAPFault();

    StringBuffer buffer = new StringBuffer();

    ResourceBundle bundle = ResourceLocator.getBundle();

    for (Error error : errs.get()) {
      String msg = bundle.getString(error.getKey());

      if (msg == null) {
        buffer.append("Could not find resource for key: " + error.getKey()); //$NON-NLS-1$
        LOGGER.severe("Error creating SOAP fault message. Missing resource for key: " + error.getKey()); //$NON-NLS-1$
      } else {
        buffer.append(MessageFormatter.format(msg, error.getValues()));
      }
      buffer.append("\n"); //$NON-NLS-1$
    }

    fault.setDetailMessage(buffer.toString(), true);

    return fault.getElement();
  }
View Full Code Here

Examples of org.megatome.frame2.util.soap.SOAPFault

      return result;
   }

   private Element createFault(Throwable e) {
      SOAPFault fault = new SOAPFault();

      fault.setDetailMessage(e.getMessage(), true);

      Element elem = null;

      try {
         elem = fault.getElement();
      } catch (SOAPException se) {
         LOGGER.warn("Unable to generate SOAP fault", se); //$NON-NLS-1$
      }

      return elem;
View Full Code Here

Examples of org.springframework.ws.soap.SoapFault

        Assert.isInstanceOf(SoapMessage.class, messageContext.getResponse(),
                "SimpleSoapExceptionResolver requires a SoapMessage");
        SoapMessage response = (SoapMessage) messageContext.getResponse();
        String faultString = StringUtils.hasLength(ex.getMessage()) ? ex.getMessage() : ex.toString();
        SoapBody body = response.getSoapBody();
        SoapFault fault = body.addServerOrReceiverFault(faultString, getLocale());
        customizeFault(messageContext, endpoint, ex, fault);
        return true;
    }
View Full Code Here

Examples of org.springframework.ws.soap.server.endpoint.annotation.SoapFault

*/
public class SoapFaultAnnotationExceptionResolver extends AbstractSoapFaultDefinitionExceptionResolver {

    @Override
    protected final SoapFaultDefinition getFaultDefinition(Object endpoint, Exception ex) {
        SoapFault faultAnnotation = ex.getClass().getAnnotation(SoapFault.class);
        if (faultAnnotation != null) {
            SoapFaultDefinition definition = new SoapFaultDefinition();
            if (faultAnnotation.faultCode() != FaultCode.CUSTOM) {
                definition.setFaultCode(faultAnnotation.faultCode().value());
            }
            else if (StringUtils.hasLength(faultAnnotation.customFaultCode())) {
                definition.setFaultCode(QName.valueOf(faultAnnotation.customFaultCode()));
            }
            definition.setFaultStringOrReason(faultAnnotation.faultStringOrReason());
            definition.setLocale(StringUtils.parseLocaleString(faultAnnotation.locale()));
            return definition;
        }
        else {
            return null;
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.