ArcGIS Simple Server Object Extension
// Copyright 2009 ESRI
// All rights reserved under the copyright laws of the United States
// and applicable international laws, treaties, and conventions.
// You may freely redistribute and use this sample code, with or
// without modification, provided you include the original copyright
// notice and use restrictions.
// See the use restrictions.

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using ESRI.ArcGIS.Carto;
using ESRI.ArcGIS.esriSystem;
using ESRI.ArcGIS.Server;
using ESRI.ArcGIS.Geometry;
using SimpleSOEInterfaces_CSharp;

public partial class _Default : System.Web.UI.Page 
    protected void Page_Load(object sender, EventArgs e)

    // Simple example of calling a method on the SOE SOAP Proxy.  
    // SOAP message is passed to the SOE, processed, and a SOAP response is generated.  
    protected void Button2_Click(object sender, EventArgs e)
        SimpleSOEProxy.Yellowstone_SimpleSOE_CSharp simpleSOEProxy = 
            new SimpleSOEProxy.Yellowstone_SimpleSOE_CSharp();

        string timeOnSOC = simpleSOEProxy.GetServerTime();

        string jsResult = string.Format("window.status = '{0}'; alert('Time on SOC: {0}');", timeOnSOC);
        // Register the call to processCallbackResult as a script on the client.
        System.Web.UI.ScriptManager.RegisterClientScriptBlock(Page, sender.GetType(), "servertime",
            jsResult, true);