I have the following:

 var popProto = new OpenLayers.Protocol.WFS({
    url:  WFS_HOST,
    version: "1.1.0",
    featureType: layerName,
    featureNS: namespace,
    srsName: "EPSG:4326",
    propertyNames: ["grid_code"],
    defaultFilter: popFilter

which I wish to convert to GML so that I can chain it to a WPS request. I've been looking around for sometime, but I can't get a way out. Any suggestions on how I can convert this to GML format will be appreciated very much.

UPDATE: Below is my attempt so far:

function createWPSExecuteRequest(namespace, layerName, popFilter) {
    var request = OpenLayers.Format.XML.prototype.write(new OpenLayers.Format.WPSExecute().writeNode('wps:Execute', {
        identifier: 'gs:Aggregate',
        dataInputs: [{
            identifier: 'features',
            reference: {
                mimeType: 'text/xml',
                href: WFS_HOST,
                method: 'POST',
                body: {
                    wfs: {
                        featureType: layerName,
                        version: '1.1.0',
                        featureNS: namespace,
                        srsName: "EPSG:4326",
                        propertyNames: ["grid_code"],
                        defaultFilter: popFilter
            identifier: 'aggregationAttribute',
            data: {literalData: 'grid_code'}
            .....more inputs here....
        responseForm: {
            rawDataOutput: {
                identifier: 'result'

    return request;

But the identifier: 'aggregationAttribute' and defaultFilter: popFilter is not being included in the generated GML. IS there anything I may be doing wrong?


If you look at the response in firebug you will see that WFS responds all the features in GML format.

If you just want the GML and not the openlayers features call the WFS (WFS_HOST) rest service directly. much of the response is in GML.

| improve this answer | |
  • I want to convert the request to GML, not the response. In GML, I can easily chain it to a WPS request, and send both as one request. – okello Jul 27 '12 at 5:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.