Giter VIP home page Giter VIP logo

Comments (5)

jratike80 avatar jratike80 commented on June 11, 2024

Regular http query from the demo server does not print http headers

https://demo.mapserver.org/cgi-bin/wfs?SERVICE=WFS&VERSION=2.0.0&REQUEST=getfeature&TYPENAME=foo&MAXFEATURES=100

Could you try similar query with your server? If issue appears to be something specific to Mapscript, please try to write ans attach a re-producible example. It would be excellent if you could make the issue to happen with demo.mapserver.org.

from mapserver.

ghschier avatar ghschier commented on June 11, 2024

OK, it seems that msIO_getAndStripStdoutBufferMimeHeaders solves the problem, as described here: #6762

For testing (to demonstrate the problem) I used the following code (SWIG-Mapscript):

<?php 

$mapfile = <<<MAPFILE
MAP
  WEB
    METADATA
      "ows_enable_request"	"*"
      "wfs_onlineresource"	"http://127.0.0.1/cities"
    END # METADATA
  END # WEB

  LAYER
    CONNECTION "cities.gml"
    CONNECTIONTYPE OGR
    ENCODING "UTF-8"
    METADATA
      "gml_include_items"	"all"
    END # METADATA
    NAME "cities"
    PROJECTION
      "init=epsg:4326"
    END # PROJECTION
    TYPE POINT
  END # LAYER
END
MAPFILE;

$objMap = mapscript::msLoadMapFromString($mapfile, NULL);

$request = new OWSRequest();
foreach ($_GET as $key => $value) $request->setParameter($key, $value);

mapscript::msIO_installStdoutToBuffer();

$objMap->owsdispatch($request);

$contenttype = mapscript::msIO_stripStdoutBufferContentType();
mapscript::msIO_stripStdoutBufferContentHeaders();

//to show the plain output in the browser:
header('Content-Type: text/plain');

print mapscript::msIO_getStdoutBufferBytes();

The following request works as expected:
example.php?SERVICE=WFS&REQUEST=GetFeature&VERSION=2.0.0&TYPENAMES=cities

This request outputs the HTTP-headers in the HTTP-Body:
example.php?SERVICE=WFS&REQUEST=GetFeature&VERSION=2.0.0&TYPENAMES=foo

As said above, with msIO_getAndStripStdoutBufferMimeHeaders it works, but the function didn't exist in PHP-Mapscript.
I agree with the author of #6762 in that the functionnames are misleading.
Any documentation would be fine.

from mapserver.

jmckenna avatar jmckenna commented on June 11, 2024

@ghschier thanks for the research. I'm sure we'd be open to renaming these confusingly-named functions, but that would have to be for a MapServer 9.0 release. Would you mind filing a new issue for the renaming (and stating the new and old names there)? Thanks.

Regarding documentation (it sounds like it is perfect timing as it is so fresh in your mind) we're always open for pull requests.

from mapserver.

ghschier avatar ghschier commented on June 11, 2024

Opened new issue #6944.

from mapserver.

jmckenna avatar jmckenna commented on June 11, 2024

Thanks @ghschier the new issue is very clear, I'd be in support of those changes.

Closing this issue here.

from mapserver.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.