Package net.opengis.ows11

Examples of net.opengis.ows11.ExceptionReportType


            ByteArrayOutputStream trace = new ByteArrayOutputStream();
            exception.printStackTrace(new PrintStream(trace));
            e.getExceptionText().add(new String(trace.toByteArray()));
        }

        ExceptionReportType report = factory.createExceptionReportType();
        report.setVersion("1.0.0");
        report.getException().add(e);

        request.getHttpResponse().setContentType("application/xml");

        //response.setCharacterEncoding( "UTF-8" );
        OWSConfiguration configuration = new OWSConfiguration();
View Full Code Here


        document = dom(xml);
        Object result = parse(OWS.EXCEPTIONREPORT);

        assertNotNull(result);
        assertTrue(result instanceof ExceptionReportType);
        ExceptionReportType er = (ExceptionReportType) result;

        assertEquals("1.0.0", er.getVersion());
        assertEquals(1, er.getException().size());
        ExceptionType ex = (ExceptionType) er.getException().get(0);
        assertEquals("InvalidParameterValue", ex.getExceptionCode());
        assertEquals("service", ex.getLocator());
        assertEquals(1, ex.getExceptionText().size());
        assertEquals("No service: ( madeUp )", ex.getExceptionText().get(0));
    }
View Full Code Here

            method.releaseConnection();
        }

        // convert a service exception into an IOException if necessary
        if (response instanceof ExceptionReportType) {
            ExceptionReportType report = (ExceptionReportType) response;
            StringBuilder sb = new StringBuilder("The Unit service reported a failure: ");
            for (Iterator it = report.getException().iterator(); it.hasNext();) {
                ExceptionType et = (ExceptionType) it.next();
                for (Iterator eit = et.getExceptionText().iterator(); eit.hasNext();) {
                    String text = (String) eit.next();
                    sb.append(text);
                    if (eit.hasNext())
View Full Code Here

            ByteArrayOutputStream trace = new ByteArrayOutputStream();
            exception.printStackTrace(new PrintStream(trace));
            e.getExceptionText().add(new String(trace.toByteArray()));
        }

        ExceptionReportType report = factory.createExceptionReportType();
        report.setVersion("1.0.0");
        report.getException().add(e);

        if (!request.isSOAP()) {
            //there will already be a SOAP mime type
            request.getHttpResponse().setContentType("application/xml");
        }
View Full Code Here

        document = dom(xml);
        Object result = parse(OWS.EXCEPTIONREPORT);

        assertNotNull(result);
        assertTrue(result instanceof ExceptionReportType);
        ExceptionReportType er = (ExceptionReportType) result;

        assertEquals("1.0.0", er.getVersion());
        assertEquals(1, er.getException().size());
        ExceptionType ex = (ExceptionType) er.getException().get(0);
        assertEquals("InvalidParameterValue", ex.getExceptionCode());
        assertEquals("service", ex.getLocator());
        assertEquals(1, ex.getExceptionText().size());
        assertEquals("No service: ( madeUp )", ex.getExceptionText().get(0));
    }
View Full Code Here

            method.releaseConnection();
        }

        // convert a service exception into an IOException if necessary
        if (response instanceof ExceptionReportType) {
            ExceptionReportType report = (ExceptionReportType) response;
            StringBuilder sb = new StringBuilder("The Unit service reported a failure: ");
            for (Iterator it = report.getException().iterator(); it.hasNext();) {
                ExceptionType et = (ExceptionType) it.next();
                for (Iterator eit = et.getExceptionText().iterator(); eit.hasNext();) {
                    String text = (String) eit.next();
                    sb.append(text);
                    if (eit.hasNext())
View Full Code Here

            ByteArrayOutputStream trace = new ByteArrayOutputStream();
            exception.printStackTrace(new PrintStream(trace));
            e.getExceptionText().add(new String(trace.toByteArray()));
        }

        ExceptionReportType report = factory.createExceptionReportType();
        report.setVersion("1.0.0");
        report.getException().add(e);

        request.getHttpResponse().setContentType("application/xml");

        //response.setCharacterEncoding( "UTF-8" );
        OWSConfiguration configuration = new OWSConfiguration();
View Full Code Here

    @SuppressWarnings("unchecked")
    public Object read(Object request, Map kvp, Map rawKvp) throws Exception {
        // make sure we get the right accepts versions param -> workaround for GEOS-1719
        if(rawKvp.containsKey("acceptVersions")) {
            OWS11AcceptVersionsKvpParser avp = new OWS11AcceptVersionsKvpParser();
            AcceptVersionsType avt = (AcceptVersionsType) avp.parse((String) rawKvp.get("acceptVersions"));
            kvp.put("acceptVersions", avt);
        }
        request = super.read(request, kvp, rawKvp);

        return request;
View Full Code Here

    public Object parse(String value) throws Exception {
        List<String> versions = KvpUtils.readFlat(value);
        for (String version : versions) {
            RequestUtils.checkVersionNumber(version, "AcceptVersions");
        }
        AcceptVersionsType accepts = Ows11Factory.eINSTANCE.createAcceptVersionsType();
        accepts.getVersion().addAll(versions);
        return accepts;
    }
View Full Code Here

    public Object read(Object request, Map kvp, Map rawKvp) throws Exception {
        // make sure we get the right accepts versions param -> workaround for GEOS-1719
        if(rawKvp.containsKey("acceptVersions")) {
            AcceptVersionsKvpParser avp = new AcceptVersionsKvpParser();
            AcceptVersionsType avt = (AcceptVersionsType) avp.parse((String) rawKvp.get("acceptVersions"));
            kvp.put("acceptVersions", avt);
        }
        request = super.read(request, kvp, rawKvp);

        // set the version attribute on the request
        if (kvp.containsKey("version")) {
            AcceptVersionsType acceptVersions = Ows11Factory.eINSTANCE.createAcceptVersionsType();
            acceptVersions.getVersion().add(kvp.get("version"));

            GetCapabilitiesType getCapabilities = (GetCapabilitiesType) request;
            getCapabilities.setAcceptVersions(acceptVersions);
        }
View Full Code Here

TOP

Related Classes of net.opengis.ows11.ExceptionReportType

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.