コード例 #1
0
    public System.Single Add(System.Single xValue, System.Single yValue)
    {
// <Snippet2>
        SoapHeaderCollection mySoapHeaderCollection = new SoapHeaderCollection();
        MySoapHeader         mySoapHeader;

        mySoapHeader      = new MySoapHeader();
        mySoapHeader.text = "This is the first SOAP header";
        mySoapHeaderCollection.Add(mySoapHeader);
// </Snippet2>
// <Snippet3>
        mySoapHeader      = new MySoapHeader();
        mySoapHeader.text = "This is the second SOAP header";
        mySoapHeaderCollection.Add(mySoapHeader);
// </Snippet3>
// <Snippet4>
        mySoapHeader      = new MySoapHeader();
        mySoapHeader.text = "This header is inserted before the first header";
        mySoapHeaderCollection.Insert(0, mySoapHeader);
// </Snippet4>
// <Snippet5>
        mySoapHeaders = new MySoapHeader[mySoapHeaderCollection.Count];
        mySoapHeaderCollection.CopyTo(mySoapHeaders, 0);
// </Snippet5>
        object[] results = this.Invoke("Add",
                                       new object[] { xValue, yValue });
        return((System.Single)(results[0]));
    }
コード例 #2
0
        /// <summary>
        /// 获取可预约阅览室
        /// </summary>
        /// <param name="SchoolNum">学校编号</param>
        /// <param name="date">日期</param>
        /// <param name="Msg"></param>
        /// <returns></returns>
        public static bool GetCanBespeakRoomInfo(string SchoolNum, string date, out string Msg)
        {
            MySoapHeader soapHeader = InitHeader(SchoolNum);
            JObject      ja         = (JObject)JsonConvert.DeserializeObject(service.GetCanBespeakRoomInfo(soapHeader, date));

            Msg = ja["Msg"].ToString();
            return(Convert.ToBoolean(ja["Result"].ToString()));
        }
コード例 #3
0
        public static EAEAService.MySoapHeader SoapHeader()
        {
            MySoapHeader header = new MySoapHeader();

            header.username = "******";
            header.password = "******";
            return(header);
        }
コード例 #4
0
        /// <summary>
        /// 续时
        /// </summary>
        /// <param name="SchoolNum"></param>
        /// <param name="studentNo"></param>
        /// <returns></returns>
        public static string DelayTime(string SchoolNum, string studentNo)
        {
            MySoapHeader soapHeader = InitHeader(SchoolNum);
            JObject      ja         = (JObject)JsonConvert.DeserializeObject(service.DelayTime(soapHeader, studentNo));

            // Msg = ja["Msg"].ToString();
            return(ja["Result"].ToString());
        }
コード例 #5
0
        /// <summary>
        /// 获取座位预约信息
        /// </summary>
        /// <param name="SchoolNum"></param>
        /// <param name="seatNo"></param>
        /// <param name="roomNo"></param>
        /// <param name="bespeakTime"></param>
        /// <returns></returns>
        public static string GetSeatBespeakInfo(string SchoolNum, string seatNo, string roomNo, string bespeakTime, out string outMsg)
        {
            MySoapHeader soapHeader = InitHeader(SchoolNum);
            JObject      ja         = (JObject)JsonConvert.DeserializeObject(service.GetSeatBespeakInfo(soapHeader, seatNo, roomNo, bespeakTime));

            outMsg = ja["Msg"].ToString();
            return(ja["Result"].ToString());
        }
コード例 #6
0
        /// <summary>
        /// 获取阅览室可预约座位
        /// </summary>
        /// <param name="SchoolNum">学校编号</param>
        /// <param name="roomNo">阅览室编号</param>
        /// <param name="bespeakTime">预约时间</param>
        /// <param name="Msg"></param>
        /// <returns></returns>
        public static bool GetRoomBesapeakState(string SchoolNum, string roomNo, string bespeakTime, out string Msg)
        {
            MySoapHeader soapHeader = InitHeader(SchoolNum);
            JObject      ja         = (JObject)JsonConvert.DeserializeObject(service.GetRoomBesapeakState(soapHeader, roomNo, bespeakTime));

            Msg = ja["Msg"].ToString();
            return(Convert.ToBoolean(ja["Result"].ToString()));
        }
コード例 #7
0
        /// <summary>
        /// 取消当日预约记录
        /// </summary>
        /// <param name="SchoolNum"></param>
        /// <param name="studentNo"></param>
        /// <param name="Msg"></param>
        /// <returns></returns>
        public static bool CancelBesapeakByCardNo(string SchoolNum, string studentNo, out string Msg)
        {
            MySoapHeader soapHeader = InitHeader(SchoolNum);
            JObject      ja         = (JObject)JsonConvert.DeserializeObject(service.CancelBesapeakByCardNo(soapHeader, studentNo, DateTime.Now.ToString("yyyy-MM-dd")));

            Msg = ja["Msg"].ToString();
            return(Convert.ToBoolean(ja["Result"].ToString()));
        }
コード例 #8
0
        /// <summary>
        /// 根据预约编号取消订单
        /// </summary>
        /// <param name="SchoolNum"></param>
        /// <param name="bespeakId"></param>
        /// <param name="Msg"></param>
        /// <returns></returns>
        public static bool CancelBesapeak(string SchoolNum, int bespeakId, out string Msg)
        {
            MySoapHeader soapHeader = InitHeader(SchoolNum);
            JObject      ja         = (JObject)JsonConvert.DeserializeObject(service.CancelBesapeak(soapHeader, bespeakId));

            Msg = ja["Msg"].ToString();
            return(Convert.ToBoolean(ja["Result"].ToString()));
        }
コード例 #9
0
        /// <summary>
        /// 获取当前用户状态
        /// </summary>
        /// <param name="SchoolNum">学校编号</param>
        /// <param name="studentNo">学员编号</param>
        /// <param name="isCheckCode">是否签到扫码</param>
        /// <param name="Msg">返回消息,如果成功返回用户状态</param>
        /// <returns>是否调用成功</returns>
        public static bool GetUserNowState(string SchoolNum, string studentNo, bool isCheckCode, out string Msg)
        {
            MySoapHeader soapHeader = InitHeader(SchoolNum);
            JObject      ja         = (JObject)JsonConvert.DeserializeObject(service.GetUserNowState(soapHeader, studentNo, isCheckCode));

            Msg = ja["Msg"].ToString();
            return(Convert.ToBoolean(ja["Result"].ToString()));
        }
コード例 #10
0
        /// <summary>
        /// 获取阅览室使用状态
        /// </summary>
        /// <param name="SchoolNum"></param>
        /// <param name="Msg"></param>
        /// <returns></returns>
        public static bool GetLibraryNowState(string SchoolNum, out string Msg)
        {
            MySoapHeader sopaHeadder = InitHeader(SchoolNum);
            JObject      ja          = (JObject)JsonConvert.DeserializeObject(service.GetLibraryNowState(sopaHeadder));

            Msg = ja["Msg"].ToString();
            return(Convert.ToBoolean(ja["Result"].ToString()));
        }
コード例 #11
0
        /// <summary>
        /// 获取进出记录
        /// </summary>
        /// <param name="SchoolNum">学校编号</param>
        /// <param name="studentNo">读者学号</param>
        /// <param name="pageIndex">页码(从0开始为第一页)</param>
        /// <param name="pageSize">数据数目,每页显示多少数据</param>
        /// <param name="Msg">返回消息,如果成功返回进出记录</param>
        /// <returns>是否调用成功</returns>
        public static bool GetEnterOutLog(string SchoolNum, string studentNo, int pageIndex, int pageSize, out string Msg)
        {
            MySoapHeader soapHeader = InitHeader(SchoolNum);
            JObject      ja         = (JObject)JsonConvert.DeserializeObject(service.GetEnterOutLog(soapHeader, studentNo, pageIndex, pageSize));

            Msg = ja["Msg"].ToString();
            return(Convert.ToBoolean(ja["Result"].ToString()));
        }
コード例 #12
0
        /// <summary>
        /// 预约提交
        /// </summary>
        /// <param name="SchoolNum">学校编号</param>
        /// <param name="seatNo">完整座位编号</param>
        /// <param name="roomNo">阅览室编号</param>
        /// <param name="studentNo">学员编号</param>
        /// <param name="besapeakTime">预约日期</param>
        /// <param name="isNowBesapeak">是否及时预约</param>
        /// <param name="Msg"></param>
        /// <returns></returns>
        public static bool SubmitBesapeskSeat(string SchoolNum, string seatNo, string roomNo, string studentNo, string besapeakTime, bool isNowBesapeak, out string Msg)
        {
            MySoapHeader soapHeader = InitHeader(SchoolNum);
            JObject      ja         = (JObject)JsonConvert.DeserializeObject(service.SubmitBesapeskSeat(soapHeader, seatNo, roomNo, studentNo, besapeakTime, isNowBesapeak));

            Msg = ja["Msg"].ToString();
            return(Convert.ToBoolean(ja["Result"].ToString()));
        }
コード例 #13
0
        /// <summary>
        /// 更换座位
        /// </summary>
        /// <param name="SchoolNum">学校编号</param>
        /// <param name="seatNo">座位号</param>
        /// <param name="roomNo">阅览室</param>
        /// <param name="studentNo">学员编号</param>
        /// <param name="Msg"></param>
        /// <returns></returns>
        public static bool ChangeSeat(string SchoolNum, string seatNo, string roomNo, string studentNo, out string Msg)
        {
            MySoapHeader soapHeader = InitHeader(SchoolNum);
            JObject      ja         = (JObject)JsonConvert.DeserializeObject(service.ChangeSeat(soapHeader, seatNo, roomNo, studentNo));

            Msg = ja["Msg"].ToString();
            return(Convert.ToBoolean(ja["Result"].ToString()));
        }
コード例 #14
0
        public static MySoapHeader InitHeader(string SchoolNum)
        {
            service.Endpoint.Address = new System.ServiceModel.EndpointAddress(GetAppSettings.WebServiceURL);
            MySoapHeader soapHeader = new MySoapHeader();

            soapHeader.UserName  = GetAppSettings.SoapUser;
            soapHeader.PassWord  = GetAppSettings.SoapPwd;
            soapHeader.SchoolNum = SchoolNum;
            return(soapHeader);
        }
コード例 #15
0
ファイル: soapmessage.cs プロジェクト: ruo2012/samples-1
 public System.Single Add(System.Single xValue, System.Single yValue,
                          out System.Single returnValue)
 {
     mySoapHeader      = new MySoapHeader();
     mySoapHeader.text = "This is the first SOAP header";
     object[] results = this.Invoke("Add",
                                    new object[] { xValue, yValue });
     returnValue = (System.Single)results[1];
     return((System.Single)(results[0]));
 }
コード例 #16
0
 public System.Single Add(System.Single xValue, System.Single yValue)
 {
     mySoapHeader        = new MySoapHeader();
     mySoapHeader.number = 0;
     object[] results = this.Invoke("Add", new object[] {
         xValue,
         yValue
     });
     return((System.Single)(results[0]));
 }
コード例 #17
0
ファイル: WebService1.asmx.cs プロジェクト: xrfmail/GitHub
        public string HelloWorld()
        {
            MySoapHeader aa = new MySoapHeader();
            PropertyInfo p  = aa.GetType().GetProperty("Password");

            p.SetValue(aa, "123456", null);
            if (_MySoapHeader.Name == "KG" && _MySoapHeader.Password == "123456")
            {
                return(ss + "Hello World");
            }
            return("faild");
        }
コード例 #18
0
        protected void Page_Load(object sender, EventArgs e)
        {
            WebForm.WebService webService = new WebService();   //web引用
            MySoapHeader       header     = new MySoapHeader(); //web引用创建soap头对象

            //设置soap头变量
            header.UserName = "******";    //"jht";
            header.PassWord = "******"; //"jhtpass";

            webService.header = header;

            //调用web 方法
            Response.Write(webService.HelloWorld("我是Jimmy Huang, how are you?"));
        }
コード例 #19
0
ファイル: SMSx.cs プロジェクト: Xiaoyuyexi/LMS
 public static void PushToPhone(string phone, string text)
 {
     try
     {
         SMS.SendMessageSoapClient client = new SendMessageSoapClient();
         MySoapHeader header = new MySoapHeader();
         header.PassWord = C.SMSTOKEN;
         string s = client.sendmsg(header, phone, "1", "7", text, "远程学员");
         log.Info(s);
     }
     catch (Exception ex)
     {
         log.Warn("{0},{1}", ex.Message, ex.Source);
     }
 }
コード例 #20
0
        /// <summary>
        /// 验证客户端连接权限
        /// </summary>
        /// <param name="myHeader"></param>
        /// <param name="isCheckSchool"></param>
        /// <returns></returns>
        public bool CheckSoapHeader(MySoapHeader myHeader, bool isCheckSchool)
        {
            return(true);

            if (!myHeader.UserName.Equals(soapUserName) || !MD5Algorithm.GetMD5Str32(myHeader.PassWord).Equals(soapPwd))
            {
                return(false);
            }
            if (!isCheckSchool)
            {
                return(true);
            }
            AMS.Model.AMS_School school = AMS.ServiceProxy.AMS_SchoolProxy.GetSchoolInfoByNum(myHeader.SchoolNum);
            return(school != null && school.AppOpen);
        }
コード例 #21
0
        /// <summary>
        /// 获取服务执行程序
        /// </summary>
        /// <param name="url"></param>
        /// <returns></returns>
        public JobDataHandler GetReJobDataHandler(string url)
        {
            JobDataHandler rjdh = new JobDataHandler();

            rjdh.Url     = url;
            rjdh.Timeout = 30000;

            MySoapHeader soapHeader = new MySoapHeader();

            soapHeader.AuthCode = "2015071794367825";

            rjdh.MySoapHeaderValue = soapHeader;

            return(rjdh);
        }
コード例 #22
0
        static void Main(string[] args)
        {
            TestWebServiceSoapClient client = new TestWebServiceSoapClient();

            MySoapHeader header = new MySoapHeader();

            header.UserName = "******";
            header.PassWord = "******";
            var result = client.HelloWorldWithUserNameAndPassWord(header);

            Console.WriteLine(result);

            client.HelloWorldWithLog();
            client.HelloWorldWithLog2();
            Console.Read();
        }
コード例 #23
0
    public System.Single Add(System.Single xValue, System.Single yValue)
    {
        SoapHeaderCollection mySoapHeaderCollection = new SoapHeaderCollection();
        MySoapHeader         myFirstSoapHeader;

        myFirstSoapHeader      = new MySoapHeader();
        myFirstSoapHeader.Text = "This is the first soap header";
        mySoapHeaderCollection.Add(myFirstSoapHeader);

        MySoapHeader mySecondSoapHeader = new MySoapHeader();

        mySecondSoapHeader.Text = "This is the second soap header";
        mySoapHeaderCollection.Add(mySecondSoapHeader);
// <Snippet1>
        // Check to see whether the collection contains mySecondSoapHeader.
        if (mySoapHeaderCollection.Contains(mySecondSoapHeader))
        {
            // Get the index of mySecondSoapHeader from the collection.
            Console.WriteLine("Index of mySecondSoapHeader: " +
                              mySoapHeaderCollection.IndexOf(mySecondSoapHeader));

            // Get the SoapHeader from the collection.
            MySoapHeader mySoapHeader1 = (MySoapHeader)mySoapHeaderCollection
                                         [mySoapHeaderCollection.IndexOf(mySecondSoapHeader)];
            Console.WriteLine("SoapHeader retrieved from the collection: "
                              + mySoapHeader1);

            // Remove a SoapHeader from the collection.
            mySoapHeaderCollection.Remove(mySoapHeader1);
            Console.WriteLine("Number of items after removal: {0}",
                              mySoapHeaderCollection.Count);
        }
        else
        {
            Console.WriteLine(
                "mySoapHeaderCollection does not contain mySecondSoapHeader.");
        }
// </Snippet1>

        mySoapHeaders = new MySoapHeader[mySoapHeaderCollection.Count];
        mySoapHeaderCollection.CopyTo(mySoapHeaders, 0);
        object[] results = this.Invoke("Add", new object[] {
            xValue,
            yValue
        });
        return((System.Single)(results[0]));
    }
コード例 #24
0
ファイル: SMSx.cs プロジェクト: cvs1989/hooyeswidget
 public static R PushToPhone(string phone, string text)
 {
     var r = new R();
     try
     {
         com.hooyes.lms.LMSMonitor.SMS.SendMessageSoapClient client = new SendMessageSoapClient();
         MySoapHeader header = new MySoapHeader();
         header.PassWord = C.SMSTOKEN;
         string s = client.sendmsg(header, phone, "1", "7", text, "远程学员");
         log.Info(s);
         r.Code = 0;
         r.Message = s;
     }
     catch (Exception ex)
     {
         r.Code = 300;
         r.Message = ex.Message;
         log.Warn("{0},{1}", ex.Message, ex.Source);
     }
     return r;
 }
コード例 #25
0
ファイル: HomeController.cs プロジェクト: iamshen/iduo.Screen
        /// <summary>
        /// 大屏首页
        /// </summary>
        /// <param name="height"></param>
        /// <param name="width"></param>
        /// <returns></returns>
        public ActionResult Index(int height = 3, int width = 3)
        {
            var userid  = "";
            var cookies = "";

            #region 默认九宫格布局3X3

            var num     = height * width;
            var lessNum = num - 1;
            ViewBag.num     = num;
            ViewBag.lessNum = lessNum;

            #endregion 默认九宫格布局3X3

            #region 获取应用

            List <AppViewModel> appData = new List <AppViewModel>();
            if (Request.Cookies["bigscreen"] != null)
            {
                cookies = Request.Cookies["bigscreen"].Value;
            }


            if (!string.IsNullOrEmpty(cookies))
            {
                try
                {
                    cookies = cookies.Substring(0, cookies.Length - 1);
                    cookies = cookies.Substring(1);
                    JObject obj = (JObject)JsonConvert.DeserializeObject(cookies);
                    userid = obj["userid"].ToString();

                    APPSoapClient _app   = new APPSoapClient();
                    MySoapHeader  header = new MySoapHeader()
                    {
                        UserName = userid, PassWord = "******"
                    };
                    //应用
                    string app = _app.GetAppByClass(header, null, 1, 1000, 3);
                    appData      = GetAppModel(app);
                    AppViewModel = appData;
                }
                catch (Exception ex)
                {
                    appData = null;
                }
            }
            else
            {
                appData = null;
            }



            #endregion 获取应用

            #region 新闻通告

            //教学通知
            var teachingnotice = "";
            //教学动态
            var teachingTrends = "";
            //讲座预告
            var lectureNotice = "";
            //数量
            var teachingnoticeCount = "";
            var teachingTrendsCount = "";
            var lectureNoticeCount  = "";

            //获取新闻通告
            if (!string.IsNullOrEmpty(newsUrl))
            {
                teachingnotice = Common.Common.GetNotice(newsUrl, "", 1, 4, 1);
                teachingTrends = Common.Common.GetNotice(newsUrl, "", 2, 4, 1);
                lectureNotice  = Common.Common.GetNotice(newsUrl, "", 3, 4, 1);
            }
            //获取新闻的数量
            if (!string.IsNullOrEmpty(newsCountUrl))
            {
                teachingnoticeCount = Common.Common.GetNoticeCount(newsCountUrl, 1);
                teachingTrendsCount = Common.Common.GetNoticeCount(newsCountUrl, 2);
                lectureNoticeCount  = Common.Common.GetNoticeCount(newsCountUrl, 3);
            }

            var tz = Common.Common.FormatNotice(teachingnotice);
            var dt = Common.Common.FormatNotice(teachingTrends);
            var yg = Common.Common.FormatNotice(lectureNotice);

            teachingnoticeCount = tz == null ? "0" : tz.ToString();
            teachingTrendsCount = dt == null ? "0" : dt.Count().ToString();
            lectureNoticeCount  = yg == null ? "0" : yg.Count().ToString();

            ViewBag.teachingNoticeList = tz;
            ViewBag.teachingTrendsList = dt;
            ViewBag.lectureNoticeList  = yg;

            #endregion 新闻通告

            #region 校历

            var xiaoli = new SchoolCalendarVM();
            try
            {
                var result = Common.Common.GetJsonData(ServiceUrl);//请求接口获取校历数据
                xiaoli = GetCNXL(result);
                if (xiaoli != null)
                {
                    xl = xiaoli.xn + "学年" + "第" + xiaoli.xq + "学期" + "第" + xiaoli.djz + "周";
                }
            }
            catch (Exception)
            {
                xiaoli = null;
            }

            ViewBag.xiaoli = xl;

            #endregion 校历

            return(View());
        }