[mapserver-users] WMS getcapabilities error: invalid characte r

Kralidis, Tom Tom.Kralidis at ccrs.nrcan.gc.ca
Tue Jun 25 17:20:27 PDT 2002


Hi,

The problem here is the XML parsing of your response in IE, not the document
per se.

If I try to download an invalid capabilities such as below from a Perl
script, it works.  The parser is choking on the response.

In this case, if the xml encoding type is utf-8, then characters such as '&'
should be escaped as per utf-8 (see
http://www.w3.org/TR/REC-xml#NT-EncodingDecl )

So, if you change your line in your mapfile to:

WMS_ONLINERESOURCE
"http://localhost/mapserver/mapserv?map=c:\inetpub\wwwroot\tyler\demo_test.m
ap&"

..this should work.  Though the MapServer dev folks may want to add the
functionality within MapServer itself to translate such characters.

Though the 'map=/path/to/mapfile/' extension is valid as part of the WMS
onlineResource prefix element, you may want to look into configuring this as
an environment variable; check out:

http://mapserver.gis.umn.edu/doc36/wms-server-howto.html#onlineresourceurl

..for info on how to do this.

Hope this helps.

..Tom

=================================
Tom Kralidis
Systems Scientist
Canada Centre for Remote Sensing
Tel: (613) 947-1828
http://www.ccrs.nrcan.gc.ca/
=================================


> -----Original Message-----
> From: Daniel Morissette [mailto:morissette at dmsolutions.ca]
> Sent: Tuesday, June 25, 2002 6:49 PM
> To: Tyler Mitchell
> Cc: mapserver-users at lists.gis.umn.edu
> Subject: Re: [mapserver-users] WMS getcapabilities error: invalid
> character
> 
> 
> Tyler,
> 
> The problem is likely the trailing "&" character in your 
> onlineresource
> url.  A bug has been filed about this already:
> http://mapserver.gis.umn.edu/bugs/show_bug.cgi?id=139
> 
> You can try omitting the trailing "&" and IE should be 
> happier, but that
> may not work for all WMS clients.  Until this is fixed, you 
> should also
> encode the characters ":" as %3A and "\" as %5C
> 
> Daniel
> 
> 
> Tyler Mitchell wrote:
> > 
> > I'm getting this error when I do a getcapabilities to a 
> WMS.  I'm not sure
> > that I don't have problems with the map file wms settings, 
> but wondered if
> > anyone can shed some light on it for me.  Is it a bogus 
> message or does it
> > mean something that my small mind can comprehend?  Is my 
> resource url wrong
> > in my map file:
> > 
> > Mapfile setting:
> >     WMS_ONLINERESOURCE "http://localhost/mapserver/mapserv?map=c:
> > \inetpub\wwwroot\tyler\demo_test.map&"
> > 
> > Does it have to be a internet accessible url?
> > 
> > Here's the error I get (internet exploder).
> > 
> > -------------------------
> > 
> > The XML page cannot be displayed
> > Cannot view XML input using XSL style sheet. Please correct 
> the error and
> > then click the Refresh button, or try again later.
> > 
> > A name was started with an invalid character. Line 12, Position 97
> > 
> >   <OnlineResource>http://localhost/mapserver/mapserv?map=c:
> > \inetpub\wwwroot\tyler\demo_test.map&</OnlineResource>
> > 
> --------------------------------------------------------------
> ----------------------------------^
> 



More information about the MapServer-users mailing list