<div dir="ltr">I'd guess the session expired?<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, May 30, 2013 at 9:22 PM, Rémy Gourrat <span dir="ltr"><<a href="mailto:rgourrat@ag-carto.fr" target="_blank">rgourrat@ag-carto.fr</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<p class="MsoNormal"><span lang="EN-US">Hello,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">I have a .net web api wich edit feature source definition<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">At the end of the function, I update the new feature source definition by this code in the session repository<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal">“...<u></u><u></u></p>
<p class="MsoNormal" style="margin-left:35.4pt;text-indent:35.4pt">// Chargement du String xml dans une variable type MgByteSource
<u></u><u></u></p>
<p class="MsoNormal"> MgByteSource contentByteSource = new MgByteSource(encodedDefinition, encodedDefinition.Length);<u></u><u></u></p>
<p class="MsoNormal">
<u></u><u></u></p>
<p class="MsoNormal"> //Ecriture du nouveau FeatureSourceID dans la Session: en lieu et place du précédent s'appuyant sur Library<u></u><u></u></p>
<p class="MsoNormal"> <span lang="EN-US">String str_NewFeatureSourceId = FeatureSourceListElem.Replace("Library:","Session:" + sessionId);<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> MgResourceIdentifier new_MgfeatureSourceId = new MgResourceIdentifier(str_NewFeatureSourceId);<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">
<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> </span>// Sauvegarde de la ressource avec la nouvelle définition<u></u><u></u></p>
<p class="MsoNormal"> <span lang="EN-US">ag_ResourceService.SetResource(new_MgfeatureSourceId, contentByteSource.GetReader(), null);<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">…
<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">”<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">During many hours it’s running very very well
<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">And suddenly it’s failing, and after few minutes or hours or enable the iis trace it’s running well again !<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">But when it failed, my Exception Catch code is not executing in my function<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">“<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> catch (MgException mge)<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> {<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> errMsg = mge.GetExceptionMessage() + "\n" + mge.GetDetails();<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> ag_PrintMessage("ag_proc.aspx : " + "ag_SetSRSFeatureSource : ","Erreur ! Exception levée par Catch " + errMsg);<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> }<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">“<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">But I have a message in the Errors.log :<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">“<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><2013-04-26T12:12:16> 2084 Anonymous<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> Error: Permission denied to resource: Session:c3b53a1a-ae59-11e2-8000-00155d2d5706_en_MTI3LjAuMC4x0AFC0AFB0AFA//Ag Base/2 - Calques/ASSC_LDE/LDE_A_COLLEC_EP.LayerDefinition<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> StackTrace:<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> - MgResourceServiceHandler.ProcessOperation() line 80 file c:\mg-2.4-x64\mgdev\server\src\services\resource\ResourceServiceHandler.cpp<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> - MgOpSetResource.Execute() line 103 file c:\mg-2.4-x64\mgdev\server\src\services\resource\OpSetResource.cpp<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> - MgServerResourceService.SetResource() line 1064 file c:\mg-2.4-x64\mgdev\server\src\services\resource\ServerResourceService.cpp<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> - MgRepositoryManager.SetResource() line 563 file c:\mg-2.4-x64\mgdev\server\src\services\resource\RepositoryManager.cpp<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> - MgRepositoryManager.AddResource() line 536 file c:\mg-2.4-x64\mgdev\server\src\services\resource\RepositoryManager.cpp<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> - MgResourceContentManager.AddResource() line 183 file c:\mg-2.4-x64\mgdev\server\src\services\resource\ResourceContentManager.cpp<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> - MgResourceContentManager.PutDocument() line 624 file c:\mg-2.4-x64\mgdev\server\src\services\resource\ResourceContentManager.cpp<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> - MgSessionRepositoryManager.CheckPermission() line 238 file c:\mg-2.4-x64\mgdev\server\src\services\resource\SessionResourceContentManager.cpp<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> - MgSessionResourceContentManager.CheckPermission() line 235 file c:\mg-2.4-x64\mgdev\server\src\services\resource\SessionResourceContentManager.cpp“<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Somebody have an explanation for this ? is there a specific concept that I don’t understand ?<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Thanks<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Rémy<u></u><u></u></span></p>
</div>
<div style="margin-top:1em;color:#666666;font-size:11px">
AG-Carto - Bayonne
</div>
<br><hr align="left" width="300">
View this message in context: <a href="http://osgeo-org.1560.x6.nabble.com/MapGuide-2-4-Web-Net-API-SetResource-failed-1-to-2-times-tp5056933.html" target="_blank">[MapGuide 2.4] Web .Net API SetResource failed 1 to 2 times</a><br>
Sent from the <a href="http://osgeo-org.1560.x6.nabble.com/MapGuide-Users-f4182607.html" target="_blank">MapGuide Users mailing list archive</a> at Nabble.com.<br><br>_______________________________________________<br>
mapguide-users mailing list<br>
<a href="mailto:mapguide-users@lists.osgeo.org">mapguide-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/mapguide-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapguide-users</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Zac Spitzer<br>Solution Architect / Director<br>Ennoble Consultancy Australia<br>+61 405 847 168<br><br>
</div>