Do you get an actual MapServer error? It sounds like you made the right changes 
relative to the URL.

From: mapserver-users [mailto:[email protected]] On 
Behalf Of Joel Benford
Sent: Wednesday, November 09, 2016 10:17 AM
To: [email protected]
Subject: [mapserver-users] Converting a v5.6 CGI call to v6.0

Hello everybody,

I am maintaining a system for a customer that links to mapserver -- we're not 
mapserver users, they are.

Some time back, when they used mapserver v5.6, we put a partial mapserver CGI 
url in one of their configuration files. The idea was that they could edit it 
if they ever needed to in future, e.g. if they changed sever location for 
mapserver. They later upgraded to mapserver 6.0, but cjust changing the target 
server failed.

The original query substring was along the lines of:

http://someserver.ourcustomer.co.uk/MapServer/cgi-bin5.6/mapserv.exe?map=D:\Maps\CCC\Intranet52\_MapServerConfig\Surveys.map_AND_mode=ITEMNQUERYMAP_AND_qlayer=Buildings_AND_map.layer%5bBuildings%5d=TEMPLATE+'_MapServerTemplates\Buildings_fields.xml'_AND_qitem=SHORT_CODE_EMS_AND_qstring=
  {application adds the rest here depending on what the user wants on that 
invocation}

I looked at the 5.6 to 6.0 migration guide at 
http://www.mapserver.org/MIGRATION_GUIDE.html#mapserver-5-6-to-6-0-migration 
and in the CGI section it says:
    All of the query map related modes (e.g. NQUERYMAP, ITEMQUERYMAP, etc...) 
have been removed in favor of using the "qformat" parameter. That parameter 
takes an output format name or mime/type as a value and uses that to process a 
set of query results. For example:
...&mode=nquerymap&... would become ...&mode=nquery&qformat=png24&...

So I tried a simple substitution in line with that and changed our substring to:
http:// someserver.ourcustomer.co.uk 
/mapserv6/cgi-bin6.0/mapserv.exe?map=D:\Maps\CCC\Intranet52\_MapServerConfig\Surveys.map_AND_mode=ITEMNQUERY_AND_qformat=png24_AND_qlayer=Buildings_AND_map.layer%5bBuildings%5d=TEMPLATE+'_MapServerTemplates\Buildings_fields.xml'_AND_qitem=SHORT_CODE_EMS_AND_qstring<http://vishare.cardiff.gov.uk/mapserv6/cgi-bin6.0/mapserv.exe?map=D:\Maps\CCC\Intranet52\_MapServerConfig\Surveys.map_AND_mode=ITEMNQUERY_AND_qformat=png24_AND_qlayer=Buildings_AND_map.layer%5bBuildings%5d=TEMPLATE+'_MapServerTemplates\Buildings_fields.xml'_AND_qitem=SHORT_CODE_EMS_AND_qstring>=

...i.e. I changed the target from the 5.6 to 6.0 server and changed 
"mode=ITEMNQUERYMAP" to "mode=ITEMNQUERY_AND_qformat=png24"

This did not meet with success, I got a "Parameter is not valid" error with the 
following stack trace:
[ArgumentException: Parameter is not valid.]
System.Drawing.Image.FromStream(Stream stream, Boolean 
useEmbeddedColorManagement, Boolean validateImageData) +1067179
System.Drawing.Image.FromStream(Stream stream) +8
SurveysReporting.ReportProvider.GenerateReport(ReportName rnName, String 
szShortCode) +4371
Reports_Preview.Page_Load(Object sender, EventArgs e) +374
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object 
t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, 
EventArgs e) +35
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +50
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, 
Boolean includeStagesAfterAsyncPoint) +627

Superficially, this error doesn't seem to have much to do with the parameter I 
changed.

At this point, I would like to ask some more experienced mapserver users a few 
questions:


1.       Is my substitution of "mode=ITEMNQUERYMAP" to 
"mode=ITEMNQUERY_AND_qformat=png24" a viable solution in itself?

2.       Does anything else in the amended query substring above jump out as 
incorrect in v6.0?

3.       Does the error message received look like the sort of thing that would 
apply to the rest of the CGI query, i.e. the stuff that's added on the end to 
suit the specific user request?

I'm really hoping for 2, because otherwise I'll have to get our legacy 
application running and then learn mapserver syntax to change what it's sending.

Thanks in advance for any help or advice.

Joel Benford

----------------------------------------------------------------------------
The information contained in or attached to this message is the responsibility 
of the sender and is meant for the confidential use of the intended recipients. 
It does not necessarily represent the position of Aligned Assets. If you are 
not an intended recipient you are notified that you have received this 
communication in error and that review, dissemination or copying of this 
communication is prohibited.
If you have received this in error, please notify us.
Aligned Assets Limited
Unit 5
River Court
Albert Drive
Sheerwater
Woking
GU21 5RP
Company Registration No: 4610724
----------------------------------------------------------------------------
_______________________________________________
mapserver-users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/mapserver-users

Reply via email to