Exemplo n.º 1
0
        /// <summary>
        /// Asynchronously calls the ActivateSession service.
        /// </summary>
        public virtual IAsyncResult BeginActivateSession(ActivateSessionMessage message, AsyncCallback callback, object callbackData)
        {
            try
            {
                // check for bad data.
                if (message == null) throw new ArgumentNullException("message");

                // set the request context.
                SetRequestContext(RequestEncoding.Xml);

                // create handler.
                ProcessRequestAsyncResult result = new ProcessRequestAsyncResult(this, callback, callbackData, 0);
                return result.BeginProcessRequest(SecureChannelContext.Current, message.ActivateSessionRequest);
            }
            catch (Exception e)
            {
                throw CreateSoapFault(message.ActivateSessionRequest, e);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// The operation contract for the ActivateSession service.
        /// </summary>
        public virtual ActivateSessionResponseMessage ActivateSession(ActivateSessionMessage request)
        {
            ActivateSessionResponse response = null;

            try
            {
                // OnRequestReceived(message.ActivateSessionRequest);

                SetRequestContext(RequestEncoding.Xml);
                response = (ActivateSessionResponse)ActivateSession(request.ActivateSessionRequest);
                // OnResponseSent(response);
                return new ActivateSessionResponseMessage(response);
            }
            catch (Exception e)
            {
                Exception fault = CreateSoapFault(request.ActivateSessionRequest, e);
                // OnResponseFaultSent(fault);
                throw fault;
            }
        }
Exemplo n.º 3
0
 /// <summary>
 /// The operation contract for the ActivateSession service.
 /// </summary>
 public virtual ActivateSessionResponseMessage ActivateSession(ActivateSessionMessage request)
 {
     try
     {
         SetRequestContext(RequestEncoding.Xml);
         ActivateSessionResponse response = (ActivateSessionResponse)ActivateSession(request.ActivateSessionRequest);
         return new ActivateSessionResponseMessage(response);
     }
     catch (Exception e)
     {
         throw CreateSoapFault(request.ActivateSessionRequest, e);
     }
 }
Exemplo n.º 4
0
        /// <summary>
        /// Activates a previously created session or transfers the session to a new secure channel.
        /// </summary>
        public ActivateSessionResponseMessage ActivateSession(ActivateSessionMessage request)
        {
            try
            {
                lock (m_lock)
                {
                    // verify that the session is still valid.
                    Session session = VerifySession(request.RequestHeader, true);

                    // validate the client and return a new nonce that can be used for subsequent calls to activate.
                    byte[] serverNonce = session.Activate(
                        request.ClientSignature, 
                        request.LocaleIds, 
                        request.UserIdentityToken, 
                        request.UserTokenSignature);

                    // construct the response.
                    ActivateSessionResponseMessage response = new ActivateSessionResponseMessage();

                    response.ResponseHeader = CreateResponseHeader(request.RequestHeader);
                    response.ServerNonce = serverNonce;
                    response.Results = new ListOfStatusCode();
                    response.DiagnosticInfos = new ListOfDiagnosticInfo();

                    return response;
                }
            }
            catch (Exception e)
            {
                throw CreateSoapFault(request.RequestHeader, e);
            }
        }