[WebMethod]
[SoapDocumentMethod(OneWay=true)]
public void CreateMapSheetSynchronous(string emailAddress, string serviceName, string mapSheetId )
{
CreateMap(emailAddress, serviceName, mapSheetId);
}
Starting with the 1.1 release of the .NET Framework, the SDK docs now carry a caution that mandates calling EndInvoke on delegates you've called BeginInvoke on in order to avoid potential leaks. This means you cannot simply "fire-and-forget" a call to BeginInvoke without the risk of running the risk of causing problems. (from Mike's site)
delegate void CreateMapDelegate(string emailAddress, string serviceName, string mapSheetId );
[SoapDocumentMethod(OneWay=false)]
public void CreateMapSheet(string emailAddress, string serviceName, string mapSheetId )
CreateMapDelegate d = new CreateMapDelegate(CreateMapAsUser);
AsyncHelper.FireAndForget(d, emailAddress, serviceName, mapSheetId);
//Delegate
delegate void CreateMapAsUserDelegate( WindowsIdentity identity,string emailAddress, string serviceName, string mapSheetId );
/// <summary>
/// Create a map sheet using an asynchronous web method
/// </summary>
// Get the current identity - which is the impersonated
WindowsIdentity impIdent = WindowsIdentity.GetCurrent();
CreateMapAsUserDelegate d = new CreateMapAsUserDelegate(CreateMapAsUser);
AsyncHelper.FireAndForget(d, impIdent, emailAddress, serviceName, mapSheetId);
/// Create the map as a specific windows Identity.
/// This simply wraps the CreateMap function
/// with code that re-sets the impersonation on the new thread
private void CreateMapAsUser( WindowsIdentity identity, string emailAddress, string serviceName, string mapSheetId )
// Get the current identity.
System.Security.Principal.WindowsImpersonationContext wi = identity.Impersonate();
wi.Undo();
I'm Dave and this is my blog. I'm usually writing about .NET Software Development, ArcGIS, or Agile Practices, but other stuff does creep in from time to time. I hope you find something of use, and feel free to contact me if you have any questions. You can also check out my profile on LinkedIn
dojo.DTSAgile.com is our technology preview / demo site. As I and my team cook up cool things we post them here.
ArcDeveloper.net is a site that hosts a set of open source projects related to ArcGIS. This includes Tile Cache for .NET (TC4N) and Feature Server for .NET (FS4N). Come over and check it out!
Assembla is a free service that provides Subversion source control, wikis and work Tracking. The ArcDeveloper project is run from here. It rocks. Check them out today.
Agilistas is a LinkedIn group focused on discussing and promoting Agile practices. Everyone is welcome to join in the conversation as we evolve the process of creating software to make it more enjoyable for all involved.