<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 12 (filtered medium)">
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US">Hello,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I have a .net web api wich edit feature source definition<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></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<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal">“...<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:35.4pt;text-indent:35.4pt">// Chargement du String xml dans une variable type MgByteSource
<o:p></o:p></p>
<p class="MsoNormal"> MgByteSource contentByteSource = new MgByteSource(encodedDefinition, encodedDefinition.Length);<o:p></o:p></p>
<p class="MsoNormal">
<o:p></o:p></p>
<p class="MsoNormal"> //Ecriture du nouveau FeatureSourceID dans la Session: en lieu et place du précédent s'appuyant sur Library<o:p></o:p></p>
<p class="MsoNormal"> <span lang="EN-US">String str_NewFeatureSourceId = FeatureSourceListElem.Replace("Library:","Session:" + sessionId);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> MgResourceIdentifier new_MgfeatureSourceId = new MgResourceIdentifier(str_NewFeatureSourceId);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> </span>// Sauvegarde de la ressource avec la nouvelle définition<o:p></o:p></p>
<p class="MsoNormal"> <span lang="EN-US">ag_ResourceService.SetResource(new_MgfeatureSourceId, contentByteSource.GetReader(), null);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">…
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">”<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">During many hours it’s running very very well
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></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 !<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">But when it failed, my Exception Catch code is not executing in my function<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">“<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> catch (MgException mge)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> {<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> errMsg = mge.GetExceptionMessage() + "\n" + mge.GetDetails();<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> ag_PrintMessage("ag_proc.aspx : " + "ag_SetSRSFeatureSource : ","Erreur ! Exception levée par Catch " + errMsg);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> }<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">“<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">But I have a message in the Errors.log :<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">“<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><2013-04-26T12:12:16> 2084 Anonymous<o:p></o:p></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<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> StackTrace:<o:p></o:p></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<o:p></o:p></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<o:p></o:p></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<o:p></o:p></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<o:p></o:p></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<o:p></o:p></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<o:p></o:p></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<o:p></o:p></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<o:p></o:p></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“<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></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 ?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Thanks<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Rémy<o:p></o:p></span></p>
</div>
<div class="signature" 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">[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">MapGuide Users mailing list archive</a> at Nabble.com.<br/>