[mapguide-users] [MapGuide 2.4] Web .Net API SetResource failed 1 to 2 times

Rémy Gourrat rgourrat at ag-carto.fr
Thu May 30 04:22:38 PDT 2013


Hello,

I have a .net web api  wich edit feature source definition

At the end of the function, I update the new feature source definition by this code in the session repository

"...
// Chargement du String xml dans une variable type MgByteSource
                               MgByteSource contentByteSource = new MgByteSource(encodedDefinition, encodedDefinition.Length);

                               //Ecriture du nouveau FeatureSourceID dans la Session: en lieu et place du précédent s'appuyant sur Library
                               String str_NewFeatureSourceId = FeatureSourceListElem.Replace("Library:","Session:" + sessionId);
                               MgResourceIdentifier new_MgfeatureSourceId = new MgResourceIdentifier(str_NewFeatureSourceId);

                               // Sauvegarde de la ressource avec la nouvelle définition
                               ag_ResourceService.SetResource(new_MgfeatureSourceId, contentByteSource.GetReader(), null);

...
"
During many hours it's running very very  well

And suddenly it's failing, and after few minutes or hours or enable the iis trace it's running well again !

But when it failed, my Exception Catch code is not executing in my function

"
                catch (MgException mge)
                {
                               errMsg = mge.GetExceptionMessage() + "\n" + mge.GetDetails();
                               ag_PrintMessage("ag_proc.aspx : " +  "ag_SetSRSFeatureSource : ","Erreur ! Exception levée par Catch " + errMsg);
                }
"

But I have a message in the Errors.log :
"
<2013-04-26T12:12:16>                2084                                      Anonymous
 Error: Permission denied to resource: Session:c3b53a1a-ae59-11e2-8000-00155d2d5706_en_MTI3LjAuMC4x0AFC0AFB0AFA//Ag Base/2 - Calques/ASSC_LDE/LDE_A_COLLEC_EP.LayerDefinition
 StackTrace:
  - MgResourceServiceHandler.ProcessOperation() line 80 file c:\mg-2.4-x64\mgdev\server\src\services\resource\ResourceServiceHandler.cpp
  - MgOpSetResource.Execute() line 103 file c:\mg-2.4-x64\mgdev\server\src\services\resource\OpSetResource.cpp
  - MgServerResourceService.SetResource() line 1064 file c:\mg-2.4-x64\mgdev\server\src\services\resource\ServerResourceService.cpp
  - MgRepositoryManager.SetResource() line 563 file c:\mg-2.4-x64\mgdev\server\src\services\resource\RepositoryManager.cpp
  - MgRepositoryManager.AddResource() line 536 file c:\mg-2.4-x64\mgdev\server\src\services\resource\RepositoryManager.cpp
  - MgResourceContentManager.AddResource() line 183 file c:\mg-2.4-x64\mgdev\server\src\services\resource\ResourceContentManager.cpp
  - MgResourceContentManager.PutDocument() line 624 file c:\mg-2.4-x64\mgdev\server\src\services\resource\ResourceContentManager.cpp
  - MgSessionRepositoryManager.CheckPermission() line 238 file c:\mg-2.4-x64\mgdev\server\src\services\resource\SessionResourceContentManager.cpp
  - MgSessionResourceContentManager.CheckPermission() line 235 file c:\mg-2.4-x64\mgdev\server\src\services\resource\SessionResourceContentManager.cpp"


Somebody have an explanation for this ? is there a specific concept that I don't understand ?

Thanks

Rémy




-----
AG-Carto - Bayonne
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/MapGuide-2-4-Web-Net-API-SetResource-failed-1-to-2-times-tp5056933.html
Sent from the MapGuide Users mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapguide-users/attachments/20130530/3bc0fc16/attachment.html>


More information about the mapguide-users mailing list