Comments (5)
Regular http query from the demo server does not print http headers
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.
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.
@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.
Opened new issue #6944.
from mapserver.
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)
- build 8.0.1 on WIndows failed HOT 6
- Queries that find no results not returning and error message HOT 5
- Oddball crash with old version of PostGIS HOT 1
- List Expressions not output to SLD
- Wrong scale computed in tile mode HOT 6
- SLD styling ignored without error when CONNECTIONTYPE is POSTGIS. HOT 2
- uvraster not rendered correctly HOT 8
- Exception thrown with mapserv.exe & PROJ 9.2.1 HOT 6
- POSTGIS Datasource + Cluster throws error
- Invalid namespace declarations in WFS DescribeFeatureType responses HOT 2
- MapScript PHP SWIG OWSRequest loadParams problem HOT 10
- Line-Classes with multiple Styles not displayed correctly when using attributes HOT 2
- Proposal for renaming/replacing SWIG-Mapscript functions
- Expressions containing <> do not throw parsing errors
- No Possibility of Effectively Limiting Data Query Results When Using Time Dimensions HOT 21
- Demo server returns invalid header with HTTP/2 -> ogrinfo fails HOT 14
- Some SVG files doesn't display in 8.x HOT 1
- Missing stripes of information in tile raster output HOT 2
- Data not always returned within bounding box HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mapserver.