[OpenLayers-Users] GeoServer WPS process fail with OpenLayers 2: “The request body should be contained in a CDATA section”

Dominik Abrahám dominikabraham at gmail.com
Tue Aug 25 02:17:27 PDT 2015


Hi,

I am trying to create an application with WPS builder like this:
http://dev.openlayers.org/releases/OpenLayers-2.13.1/examples/wps.html
When input format = "text/xml; subtype=wfs-collection/1.0", it creates
input field for name of the layer on my server:

function addWFSCollectionInput(input) {
    var name = input.identifier;
    var field = document.createElement("input");
    field.title = input["abstract"];
    field.value = name + " (layer on the server)";
    addValueHandlers(field, function() {
        input.reference = field.value ? {
            mimeType: "text/xml; subtype=wfs-collection/1.0",
            href: "http://46.28.111.137:8080/geoserver2711/wfs",
            method: "POST",
            body: {
                wfs: {
                    version: "1.0.0",
                    outputFormat: "GML2",
                    featureType: field.value
                }
            }
        } : undefined;
    });
    document.getElementById("input").appendChild(field);
}

This input is required for example by algorithms gs:Clip and gs:Aggregate.
When I'm trying to run some of these algorithms, it returns this kind of
result:

<?xml version="1.0" encoding="UTF-8"?><wps:ExecuteResponse xmlns:xs="
http://www.w3.org/2001/XMLSchema" xmlns:wps="
http://www.opengis.net/wps/1.0.0" xmlns:ows="http://www.opengis.net/ows/1.1"
xmlns:xlink="http://www.w3.org/1999/xlink" xml:lang="en" service="WPS"
serviceInstance="http://46.28.111.137:8080/geoserver2711/ows?"
version="1.0.0"><wps:Process
wps:processVersion="1.0.0"><ows:Identifier>gs:Clip</ows:Identifier><ows:Title>Clip</ows:Title><ows:Abstract>Clips
(crops) features to a given
geometry</ows:Abstract></wps:Process><wps:Status
creationTime="2015-08-25T08:35:59.568Z"><wps:ProcessFailed><ows:ExceptionReport
version="1.1.0"><ows:Exception
exceptionCode="NoApplicableCode"><ows:ExceptionText>The request body should
be contained in a CDATA section, otherwise it will get parsed as XML
instead of being preserved as
is</ows:ExceptionText></ows:Exception></ows:ExceptionReport></wps:ProcessFailed></wps:Status></wps:ExecuteResponse>

How can I fix it?

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20150825/cb256480/attachment.html>


More information about the Users mailing list