RE: [mapserver-users] MapScript issue in multiple WCF apps (ASP.NET)

2011-03-09 Thread Brian Poteat
Thanks Tamas,
I put together a solution that mimics what I am doing at a very simple level 
and I got it to error fairly easily.

This zip contains an example mapfile and the solution used to reproduce the 
setup. I just put everything in c:\tmp\test. The applications are .NET 4.0 WCF 
endpoints and will install as IIS web services (so obviously you’ll need the 
appropriate software to build/run).
http://dl.dropbox.com/u/649621/WcfMapScript.zip

If you build the solution and then execute the following service requests in 
order, at some point the requests no longer return correct data. Asking for one 
layer will return the other. Sometimes the results vary but usually just mixing 
up the requested layers on the two different services will cause strange 
behavior.

http://localhost/MapScriptService/MapScriptService.svc/ms?mapfile=C:\tmp\test\map.mapLAYERS=L54CRS=EPSG:4326TRANSPARENT=trueSERVICE=WMSVERSION=1.1.1REQUEST=GetMapSTYLES=EXCEPTIONS=application%2Fvnd.ogc.se_inimageFORMAT=image%2FpngBBOX=60.33182566,24.9997419977717,73.0167274,30.0446813WIDTH=1032HEIGHT=358

http://localhost/MapScriptService2/MapScriptService.svc/ms?mapfile=C:\tmp\test\map.mapLAYERS=L57CRS=EPSG:4326TRANSPARENT=trueSERVICE=WMSVERSION=1.1.1REQUEST=GetMapSTYLES=EXCEPTIONS=application%2Fvnd.ogc.se_inimageFORMAT=image%2FpngBBOX=60.33182566,24.9997419977717,73.0167274,30.0446813WIDTH=1032HEIGHT=358

http://localhost/MapScriptService/MapScriptService.svc/ms?mapfile=C:\tmp\test\map.mapLAYERS=L57CRS=EPSG:4326TRANSPARENT=trueSERVICE=WMSVERSION=1.1.1REQUEST=GetMapSTYLES=EXCEPTIONS=application%2Fvnd.ogc.se_inimageFORMAT=image%2FpngBBOX=60.33182566,24.9997419977717,73.0167274,30.0446813WIDTH=1032HEIGHT=358

http://localhost/MapScriptService2/MapScriptService.svc/ms?mapfile=C:\tmp\test\map.mapLAYERS=L54CRS=EPSG:4326TRANSPARENT=trueSERVICE=WMSVERSION=1.1.1REQUEST=GetMapSTYLES=EXCEPTIONS=application%2Fvnd.ogc.se_inimageFORMAT=image%2FpngBBOX=60.33182566,24.9997419977717,73.0167274,30.0446813WIDTH=1032HEIGHT=358

I apologize for the strange requests and images but I am a not really familiar 
with the mapfile format and just tried to reproduce the requests as closely as 
they were in a real environment.
Brian


From: Tamas Szekeres [mailto:szeker...@gmail.com]
Sent: Tuesday, March 08, 2011 4:46 PM
To: Brian Poteat
Cc: mapserver-users@lists.osgeo.org
Subject: Re: [mapserver-users] MapScript issue in multiple WCF apps (ASP.NET)

Hi Brian,

Could you provide the sequence of the requests, a mapfile example, that can be 
used to reproduce this problem?
What do you mean by configure them independently? Different application pool 
for each service type?

Best regards,

Tamas


2011/3/8 Brian Poteat poteat.br...@geoeye.commailto:poteat.br...@geoeye.com
I have a very strange issue while using MapScript from within some web service 
projects. I have different projects/applications for different services – one 
for each of WCF, WMS, WFS, and WMTS – so we can configure them independently. 
MapScript requests work fine for all of them separately but if I access 
MapScript from one and then another, one of them will not work correctly 
anymore. The requests will return success (result == 0) and the format returned 
is correct but the data is either null or an incorrect image. It doesn’t seem 
to be a threading issue since I can bombard any one of the services with 
asynchronous requests and they are handled fine and the problems don’t 
necessarily come while using the different applications at the same time – just 
one then the other.

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] MapScript issue in multiple WCF apps (ASP.NET)

2011-03-09 Thread Tamas Szekeres
Hi Brian,

Got it, thanks. I'm going to inspect the problem and get back to you if I
have further questions.

Best regards,

Tamas




2011/3/9 Brian Poteat poteat.br...@geoeye.com

 Thanks Tamas,

 I put together a solution that mimics what I am doing at a very simple
 level and I got it to error fairly easily.



 This zip contains an example mapfile and the solution used to reproduce the
 setup. I just put everything in c:\tmp\test. The applications are .NET 4.0
 WCF endpoints and will install as IIS web services (so obviously you’ll need
 the appropriate software to build/run).

 http://dl.dropbox.com/u/649621/WcfMapScript.zip



 If you build the solution and then execute the following service requests
 in order, at some point the requests no longer return correct data. Asking
 for one layer will return the other. Sometimes the results vary but usually
 just mixing up the requested layers on the two different services will cause
 strange behavior.




 http://localhost/MapScriptService/MapScriptService.svc/ms?mapfile=C:\tmp\test\map.mapLAYERS=L54CRS=EPSG:4326TRANSPARENT=trueSERVICE=WMSVERSION=1.1.1REQUEST=GetMapSTYLES=EXCEPTIONS=application%2Fvnd.ogc.se_inimageFORMAT=image%2FpngBBOX=60.33182566,24.9997419977717,73.0167274,30.0446813WIDTH=1032HEIGHT=358http://localhost/MapScriptService/MapScriptService.svc/ms?mapfile=C:%5Ctmp%5Ctest%5Cmap.map%26LAYERS%3DL54%26CRS%3DEPSG:4326TRANSPARENT=trueSERVICE=WMSVERSION=1.1.1REQUEST=GetMapSTYLES=EXCEPTIONS=application%2Fvnd.ogc.se_inimageFORMAT=image%2FpngBBOX=60.33182566,24.9997419977717,73.0167274,30.0446813WIDTH=1032HEIGHT=358




 http://localhost/MapScriptService2/MapScriptService.svc/ms?mapfile=C:\tmp\test\map.mapLAYERS=L57CRS=EPSG:4326TRANSPARENT=trueSERVICE=WMSVERSION=1.1.1REQUEST=GetMapSTYLES=EXCEPTIONS=application%2Fvnd.ogc.se_inimageFORMAT=image%2FpngBBOX=60.33182566,24.9997419977717,73.0167274,30.0446813WIDTH=1032HEIGHT=358http://localhost/MapScriptService2/MapScriptService.svc/ms?mapfile=C:%5Ctmp%5Ctest%5Cmap.map%26LAYERS%3DL57%26CRS%3DEPSG:4326TRANSPARENT=trueSERVICE=WMSVERSION=1.1.1REQUEST=GetMapSTYLES=EXCEPTIONS=application%2Fvnd.ogc.se_inimageFORMAT=image%2FpngBBOX=60.33182566,24.9997419977717,73.0167274,30.0446813WIDTH=1032HEIGHT=358




 http://localhost/MapScriptService/MapScriptService.svc/ms?mapfile=C:\tmp\test\map.mapLAYERS=L57CRS=EPSG:4326TRANSPARENT=trueSERVICE=WMSVERSION=1.1.1REQUEST=GetMapSTYLES=EXCEPTIONS=application%2Fvnd.ogc.se_inimageFORMAT=image%2FpngBBOX=60.33182566,24.9997419977717,73.0167274,30.0446813WIDTH=1032HEIGHT=358http://localhost/MapScriptService/MapScriptService.svc/ms?mapfile=C:%5Ctmp%5Ctest%5Cmap.map%26LAYERS%3DL57%26CRS%3DEPSG:4326TRANSPARENT=trueSERVICE=WMSVERSION=1.1.1REQUEST=GetMapSTYLES=EXCEPTIONS=application%2Fvnd.ogc.se_inimageFORMAT=image%2FpngBBOX=60.33182566,24.9997419977717,73.0167274,30.0446813WIDTH=1032HEIGHT=358




 http://localhost/MapScriptService2/MapScriptService.svc/ms?mapfile=C:\tmp\test\map.mapLAYERS=L54CRS=EPSG:4326TRANSPARENT=trueSERVICE=WMSVERSION=1.1.1REQUEST=GetMapSTYLES=EXCEPTIONS=application%2Fvnd.ogc.se_inimageFORMAT=image%2FpngBBOX=60.33182566,24.9997419977717,73.0167274,30.0446813WIDTH=1032HEIGHT=358http://localhost/MapScriptService2/MapScriptService.svc/ms?mapfile=C:%5Ctmp%5Ctest%5Cmap.map%26LAYERS%3DL54%26CRS%3DEPSG:4326TRANSPARENT=trueSERVICE=WMSVERSION=1.1.1REQUEST=GetMapSTYLES=EXCEPTIONS=application%2Fvnd.ogc.se_inimageFORMAT=image%2FpngBBOX=60.33182566,24.9997419977717,73.0167274,30.0446813WIDTH=1032HEIGHT=358



 I apologize for the strange requests and images but I am a not really
 familiar with the mapfile format and just tried to reproduce the requests as
 closely as they were in a real environment.

 Brian





 *From:* Tamas Szekeres [mailto:szeker...@gmail.com]
 *Sent:* Tuesday, March 08, 2011 4:46 PM
 *To:* Brian Poteat
 *Cc:* mapserver-users@lists.osgeo.org
 *Subject:* Re: [mapserver-users] MapScript issue in multiple WCF apps (
 ASP.NET)



 Hi Brian,


 Could you provide the sequence of the requests, a mapfile example, that can
 be used to reproduce this problem?
 What do you mean by configure them independently? Different application
 pool for each service type?

 Best regards,

 Tamas


 2011/3/8 Brian Poteat poteat.br...@geoeye.com

 I have a very strange issue while using MapScript from within some web
 service projects. I have different projects/applications for different
 services – one for each of WCF, WMS, WFS, and WMTS – so we can configure
 them independently. MapScript requests work fine for all of them separately
 but if I access MapScript from one and then another, one of them will not
 work correctly anymore. The requests will return success (result == 0) and
 the format returned is correct but the data is either null or an incorrect
 image. It doesn’t seem to be a threading issue since I can bombard any one
 of the services with asynchronous requests and they are handled fine and the
 problems don’t necessarily come while

Re: [mapserver-users] MapScript issue in multiple WCF apps (ASP.NET)

2011-03-09 Thread Tamas Szekeres
BTW: could you file a ticket (assigned to the csharp bindings) in order to
keep the things in view?

Best regards,

Tamas



2011/3/9 Tamas Szekeres szeker...@gmail.com

 Hi Brian,

 Got it, thanks. I'm going to inspect the problem and get back to you if I
 have further questions.

 Best regards,

 Tamas




 2011/3/9 Brian Poteat poteat.br...@geoeye.com

 Thanks Tamas,

 I put together a solution that mimics what I am doing at a very simple
 level and I got it to error fairly easily.



 This zip contains an example mapfile and the solution used to reproduce
 the setup. I just put everything in c:\tmp\test. The applications are .NET
 4.0 WCF endpoints and will install as IIS web services (so obviously you’ll
 need the appropriate software to build/run).

 http://dl.dropbox.com/u/649621/WcfMapScript.zip



 If you build the solution and then execute the following service requests
 in order, at some point the requests no longer return correct data. Asking
 for one layer will return the other. Sometimes the results vary but usually
 just mixing up the requested layers on the two different services will cause
 strange behavior.




 http://localhost/MapScriptService/MapScriptService.svc/ms?mapfile=C:\tmp\test\map.mapLAYERS=L54CRS=EPSG:4326TRANSPARENT=trueSERVICE=WMSVERSION=1.1.1REQUEST=GetMapSTYLES=EXCEPTIONS=application%2Fvnd.ogc.se_inimageFORMAT=image%2FpngBBOX=60.33182566,24.9997419977717,73.0167274,30.0446813WIDTH=1032HEIGHT=358http://localhost/MapScriptService/MapScriptService.svc/ms?mapfile=C:%5Ctmp%5Ctest%5Cmap.map%26LAYERS%3DL54%26CRS%3DEPSG:4326TRANSPARENT=trueSERVICE=WMSVERSION=1.1.1REQUEST=GetMapSTYLES=EXCEPTIONS=application%2Fvnd.ogc.se_inimageFORMAT=image%2FpngBBOX=60.33182566,24.9997419977717,73.0167274,30.0446813WIDTH=1032HEIGHT=358




 http://localhost/MapScriptService2/MapScriptService.svc/ms?mapfile=C:\tmp\test\map.mapLAYERS=L57CRS=EPSG:4326TRANSPARENT=trueSERVICE=WMSVERSION=1.1.1REQUEST=GetMapSTYLES=EXCEPTIONS=application%2Fvnd.ogc.se_inimageFORMAT=image%2FpngBBOX=60.33182566,24.9997419977717,73.0167274,30.0446813WIDTH=1032HEIGHT=358http://localhost/MapScriptService2/MapScriptService.svc/ms?mapfile=C:%5Ctmp%5Ctest%5Cmap.map%26LAYERS%3DL57%26CRS%3DEPSG:4326TRANSPARENT=trueSERVICE=WMSVERSION=1.1.1REQUEST=GetMapSTYLES=EXCEPTIONS=application%2Fvnd.ogc.se_inimageFORMAT=image%2FpngBBOX=60.33182566,24.9997419977717,73.0167274,30.0446813WIDTH=1032HEIGHT=358




 http://localhost/MapScriptService/MapScriptService.svc/ms?mapfile=C:\tmp\test\map.mapLAYERS=L57CRS=EPSG:4326TRANSPARENT=trueSERVICE=WMSVERSION=1.1.1REQUEST=GetMapSTYLES=EXCEPTIONS=application%2Fvnd.ogc.se_inimageFORMAT=image%2FpngBBOX=60.33182566,24.9997419977717,73.0167274,30.0446813WIDTH=1032HEIGHT=358http://localhost/MapScriptService/MapScriptService.svc/ms?mapfile=C:%5Ctmp%5Ctest%5Cmap.map%26LAYERS%3DL57%26CRS%3DEPSG:4326TRANSPARENT=trueSERVICE=WMSVERSION=1.1.1REQUEST=GetMapSTYLES=EXCEPTIONS=application%2Fvnd.ogc.se_inimageFORMAT=image%2FpngBBOX=60.33182566,24.9997419977717,73.0167274,30.0446813WIDTH=1032HEIGHT=358




 http://localhost/MapScriptService2/MapScriptService.svc/ms?mapfile=C:\tmp\test\map.mapLAYERS=L54CRS=EPSG:4326TRANSPARENT=trueSERVICE=WMSVERSION=1.1.1REQUEST=GetMapSTYLES=EXCEPTIONS=application%2Fvnd.ogc.se_inimageFORMAT=image%2FpngBBOX=60.33182566,24.9997419977717,73.0167274,30.0446813WIDTH=1032HEIGHT=358http://localhost/MapScriptService2/MapScriptService.svc/ms?mapfile=C:%5Ctmp%5Ctest%5Cmap.map%26LAYERS%3DL54%26CRS%3DEPSG:4326TRANSPARENT=trueSERVICE=WMSVERSION=1.1.1REQUEST=GetMapSTYLES=EXCEPTIONS=application%2Fvnd.ogc.se_inimageFORMAT=image%2FpngBBOX=60.33182566,24.9997419977717,73.0167274,30.0446813WIDTH=1032HEIGHT=358



 I apologize for the strange requests and images but I am a not really
 familiar with the mapfile format and just tried to reproduce the requests as
 closely as they were in a real environment.

 Brian





 *From:* Tamas Szekeres [mailto:szeker...@gmail.com]
 *Sent:* Tuesday, March 08, 2011 4:46 PM
 *To:* Brian Poteat
 *Cc:* mapserver-users@lists.osgeo.org
 *Subject:* Re: [mapserver-users] MapScript issue in multiple WCF apps (
 ASP.NET)



 Hi Brian,


 Could you provide the sequence of the requests, a mapfile example, that
 can be used to reproduce this problem?
 What do you mean by configure them independently? Different application
 pool for each service type?

 Best regards,

 Tamas


 2011/3/8 Brian Poteat poteat.br...@geoeye.com

 I have a very strange issue while using MapScript from within some web
 service projects. I have different projects/applications for different
 services – one for each of WCF, WMS, WFS, and WMTS – so we can configure
 them independently. MapScript requests work fine for all of them separately
 but if I access MapScript from one and then another, one of them will not
 work correctly anymore. The requests will return success (result == 0) and
 the format returned is correct but the data is either null or an incorrect
 image. It doesn’t

Re: [mapserver-users] MapScript issue in multiple WCF apps (ASP.NET)

2011-03-08 Thread Tamas Szekeres
Hi Brian,

Could you provide the sequence of the requests, a mapfile example, that can
be used to reproduce this problem?
What do you mean by configure them independently? Different application
pool for each service type?

Best regards,

Tamas



2011/3/8 Brian Poteat poteat.br...@geoeye.com

 I have a very strange issue while using MapScript from within some web
 service projects. I have different projects/applications for different
 services – one for each of WCF, WMS, WFS, and WMTS – so we can configure
 them independently. MapScript requests work fine for all of them separately
 but if I access MapScript from one and then another, one of them will not
 work correctly anymore. The requests will return success (result == 0) and
 the format returned is correct but the data is either null or an incorrect
 image. It doesn’t seem to be a threading issue since I can bombard any one
 of the services with asynchronous requests and they are handled fine and the
 problems don’t necessarily come while using the different applications at
 the same time – just one then the other.



 I am using a support project for making the MS requests that is referenced
 by each application (though I tried putting the code directly in each app
 with the same results). Below is a simplified version of the helper utility
 I am using. Is there anything that stands out as being an obvious issue? My
 endpoint applications simply get the query parameters from the url request
 and pass them as the requestParams argument with the appropriate map file.

 namespace MapScript

 {

  public class MapScriptResponse

  {

  public string Format { get; set; }

  public byte[] Data { get; set; }

  public string ErrorString { get; set; }

  public DateTime LastModified { get; set; }

  }

  public class MapScriptUtilities

  {

  /// summary

  ///
  Execute a service request to mapserver through mapscript

  /// /summary

   /// param name=mapFile
 Physical path to the map file on which to make the request/param

  /// param name=requestParams
 List of request parameters/param

  /// returnsThe response from mapscript./returns

   public static MapScriptResponse ServiceRequest(string
  mapFile, Dictionarystring, string requestParams)

  {

   MapScriptResponse response = new
 MapScriptResponse();

   mapObj map = new mapObj(mapFile);

   OWSRequest owsRequest = new OWSRequest();

   Dictionarystring, string.Enumerator
  en = requestParams.GetEnumerator();

   string paramName = ;

   string paramValue = ;

   while (en.MoveNext())

   {

paramName = en.Current.Key;

paramValue = en.Current.Value;


 owsRequest.setParameter(paramName, paramValue);

   }

   mapscript.msIO_installStdoutToBuffer();

   int resultCode = map.OWSDispatch(owsRequest);

   if (resultCode == 0)

   {

response.Format = mapscript
 .msIO_stripStdoutBufferContentType();

response.Data = mapscript
 .msIO_getStdoutBufferBytes();

   }



   return response;

  }

  }

 }



 Any help would be greatly appreciated.

 Brian

 ___
 mapserver-users mailing list
 mapserver-users@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/mapserver-users


___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users