Package net.opengis.ows11

Examples of net.opengis.ows11.ExceptionType


public class ExceptionReportTest {

    @Test
    public void testEncodeException() throws Exception {
        ExceptionType e = Ows20Factory.eINSTANCE.createExceptionType();
        e.setExceptionCode("testCode");
        e.setLocator("testLocator");
        e.setExceptionText("testText");

        ExceptionReportType report = Ows20Factory.eINSTANCE.createExceptionReportType();
        report.setVersion("2.0");
        report.getException().add(e);
View Full Code Here


    }

    public static ExceptionReportType exceptionReport(ServiceException exception,
        boolean verboseExceptions, String version) {

        ExceptionType e = Ows20Factory.eINSTANCE.createExceptionType();

        if (exception.getCode() != null) {
            e.setExceptionCode(exception.getCode());
        } else {
            //set a default
            e.setExceptionCode("NoApplicableCode");
        }

        e.setLocator(exception.getLocator());

        //add the message
        StringBuffer sb = new StringBuffer();
        OwsUtils.dumpExceptionMessages(exception, sb, true);
        sb.append("\n");
        sb.append(exception.getExceptionText()); // check this
//        e.getExceptionText().add(sb.toString());
//        e.getExceptionText().addAll(exception.getExceptionText());

        if(verboseExceptions) {
            //add the entire stack trace
            //exception.
            sb.append("\nDetails:\n");
            ByteArrayOutputStream trace = new ByteArrayOutputStream();
            exception.printStackTrace(new PrintStream(trace));
            sb.append(new String(trace.toByteArray()));
        }

        e.setExceptionText(sb.toString());

        ExceptionReportType report = Ows20Factory.eINSTANCE.createExceptionReportType();

        version = version != null ? version : "2.0.0";
        report.setVersion(version);
View Full Code Here

   * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
   * @generated
   */
    public NotificationChain basicSetException(ExceptionType newException, NotificationChain msgs) {
    ExceptionType oldException = exception;
    exception = newException;
    if (eNotificationRequired()) {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, Wcs10Package.WCS_CAPABILITY_TYPE__EXCEPTION, oldException, newException);
      if (msgs == null) msgs = notification; else msgs.add(notification);
    }
View Full Code Here

    {
        EndpointReference participant = getParticipant(endpoint, addressingProperties);
        AddressingHelper.installFromFaultTo(addressingProperties, participant, identifier);
        BusinessAgreementWithCoordinatorCompletionCoordinatorPortType port;
        port = getPort(endpoint, addressingProperties, failAction);
        ExceptionType fail = new ExceptionType();
        fail.setExceptionIdentifier(exceptionIdentifier);

        port.failOperation(fail);
    }
View Full Code Here

    public void failOperation(
        @WebParam(name = "Fail", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
        ExceptionType parameters)
    {
        MessageContext ctx = webServiceCtx.getMessageContext();
        final ExceptionType fail = parameters;
        final AddressingProperties inboundAddressProperties
            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
        final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);

        TaskManager.getManager().queueTask(new Task() {
View Full Code Here

    public void failOperation(
        @WebParam(name = "Fail", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
        ExceptionType parameters)
    {
        MessageContext ctx = webServiceCtx.getMessageContext();
        final ExceptionType fail = parameters;
        final AddressingProperties inboundAddressProperties
            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
        final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);

        TaskManager.getManager().queueTask(new Task() {
View Full Code Here

    {
        EndpointReference participant = getParticipant(endpoint, addressingProperties);
        AddressingHelper.installFromFaultTo(addressingProperties, participant, identifier);
        BusinessAgreementWithParticipantCompletionCoordinatorPortType port;
        port = getPort(endpoint, addressingProperties, failAction);
        ExceptionType fail = new ExceptionType();
        fail.setExceptionIdentifier(exceptionIdentifier);

        port.failOperation(fail);
    }
View Full Code Here

    System.out.println("ZIP: " + zip);
    System.out.println("Borrowed: " + borrowed);
  }

    public static void showExceptionFrame(ExceptionFrame exceptionFrame) {
        ExceptionType type = exceptionFrame.getException().get(0);
        if (type != null && type.getExceptionText() != null) {
            System.out.print("Error message is: " + type.getExceptionText());
        }
    }
View Full Code Here

            System.out.println(name);
        }
    }

    private SeekBookError prepareException(String message) {
        ExceptionType exception = new ExceptionType();
        exception.setOperation("seekBook");
        exception.setServiceName("LibraryService");
        exception.setExceptionText(message);
        ExceptionFrame frame = new ExceptionFrame();
        frame.getException().add(exception);
        SeekBookError e = new SeekBookError("Book not found", frame);
        return e;
    }
View Full Code Here

    private void showSeekBookResponse(final ListOfBooks response ){

    }

    private SeekBookError prepareException(String message) {
        ExceptionType exception = new ExceptionType();
        exception.setOperation("seekBook");
        exception.setServiceName("LibraryService");
        exception.setExceptionText(message);
        ExceptionFrame frame = new ExceptionFrame();
        frame.getException().add(exception);
        SeekBookError e = new SeekBookError("Book not found", frame);
        return e;
    }
View Full Code Here

TOP

Related Classes of net.opengis.ows11.ExceptionType

Copyright © 2018 www.massapicom. 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.