Ejemplo n.º 1
0
        public static ejsAssignment[] GetAllPublishedAssignments(
            ejsSessionToken sessionToken, bool IncludeNotAvailable)
        {
            EjsPublicServiceClient _client = null;

            try
            {
                _client = new EjsPublicServiceClient();
                _client.Endpoint.Address = new EndpointAddress(ejsBridgeManager.EjsAddress);
                ejsAssignment[] results = _client.GetAllAssignments(sessionToken, IncludeNotAvailable);

                return(results);
            }
            catch (FaultException <ejsFailureReport> ex)
            {
                if (ex.Detail._failureCode == 7)
                {
                    sessionToken._isAuthenticated = false;
                }

                throw new ApplicationException(ex.Detail._header + "\n" + ex.Detail._originalException.Message);
            }
            catch (Exception)
            {
                sessionToken._isAuthenticated = false;
                throw new ApplicationException("EJSと接続する際に失敗しました。");
            }
            finally
            {
                if (_client != null)
                {
                    _client.Close();
                }
            }
        }