private void Setup(ClarifyApplicationWS applicationWS)
        {
            this.appWS = applicationWS;

            this.sessionProtocol = new Protocol.ClarifySessionSrv();
            sessionProtocol.AuthenticationHeaderValue = new Protocol.AuthenticationHeader();

            this.sessionProtocol.Url = new Uri(BaseUri, "ClarifySessionSrv.asmx").ToString();
        }
        internal ClarifySessionWS( ClarifyApplicationWS applicationWS, string sessionToken )
        {
            if( applicationWS == null)
                throw new ArgumentNullException("applicationWS");

            if( sessionToken == null)
                throw new ArgumentNullException("sessionToken");

            Setup( applicationWS );
            sessionProtocol.AuthenticationHeaderValue.SessionID = sessionToken;
        }
        internal ClarifySessionWS(ClarifyApplicationWS applicationWS, string sessionToken)
        {
            if (applicationWS == null)
            {
                throw new ArgumentNullException("applicationWS");
            }

            if (sessionToken == null)
            {
                throw new ArgumentNullException("sessionToken");
            }

            Setup(applicationWS);
            sessionProtocol.AuthenticationHeaderValue.SessionID = sessionToken;
        }
        protected void Application_BeginRequest(Object sender, EventArgs e)
        {
            if( ClarifyAppWS == null )
            {
                lock(SyncRoot)
                {
                    if( ClarifyAppWS == null )
                    {
                        NameValueCollection config = ConfigurationManager.AppSettings;

                        if( config["fcsdk.webservices.url"] == null )
                            throw new ApplicationException("Could not locate the appSetting 'fcsdk.webservices.url' in the web.config.");

                        ClarifyAppWS = new ClarifyApplicationWS(config["fcsdk.webservices.url"]);
                    }
                }
            }
        }
        private void Setup( ClarifyApplicationWS applicationWS )
        {
            this.appWS = applicationWS;

            this.sessionProtocol = new Protocol.ClarifySessionSrv();
            sessionProtocol.AuthenticationHeaderValue = new Protocol.AuthenticationHeader();

            this.sessionProtocol.Url = new Uri( BaseUri, "ClarifySessionSrv.asmx" ).ToString();
        }