public searchHangerInfoResponse searchHangerInfo([System.Xml.Serialization.XmlElementAttribute("searchHangerInfo", Namespace = "http://intergration.ina.ws.bxnmes.com/")] searchHangerInfo searchHangerInfo1)
        {
            object[] results = this.Invoke("searchHangerInfo", new object[] {
                searchHangerInfo1
            });

            return((searchHangerInfoResponse)(results[0]));
        }
 /// <remarks/>
 public void searchHangerInfoAsync(searchHangerInfo searchHangerInfo1, object userState)
 {
     if ((this.searchHangerInfoOperationCompleted == null))
     {
         this.searchHangerInfoOperationCompleted = new System.Threading.SendOrPostCallback(this.OnsearchHangerInfoOperationCompleted);
     }
     this.InvokeAsync("searchHangerInfo", new object[] {
         searchHangerInfo1
     }, this.searchHangerInfoOperationCompleted, userState);
 }
Example #3
0
        ///根据衣架号从MES中查
        public static searchHangerInfoResponse searchHangerInfo(string site, string hangerId)
        {
            searchHangerInfo  search  = new searchHangerInfo();
            hangerInfoRequest request = new hangerInfoRequest();

            request.site     = site;
            request.hangerId = hangerId;
            search.Request   = request;

            //认证
            string apiUsername = getAppConfig("apiUsername");
            string apiUserPwd  = getAppConfig("apiUserPwd");
            HangerBindServiceService service = new HangerBindServiceService();
            string url = getAppConfig("apiUrl");

            service.Url             = url;
            service.Credentials     = new System.Net.NetworkCredential(apiUsername, apiUserPwd);
            service.Timeout         = int.Parse(getAppConfig("Interface_Overtime")) * 1000;
            service.RequestEncoding = UTF8Encoding.UTF8;
            service.SoapVersion     = System.Web.Services.Protocols.SoapProtocolVersion.Soap11;
            service.PreAuthenticate = true;

            if (getAppConfig("runningMode") == "debug")
            {
                searchHangerInfoResponse response = new searchHangerInfoResponse();
                var returnValue = new hangerInfoResponse();
                returnValue.sfc               = "112122212_TST";
                returnValue.partId            = "112122212";
                returnValue.site              = "仓位_1";
                returnValue.statusDescription = "数据异常";
                response.@return              = returnValue;
                return(response);
            }
            else
            {
                try
                {
                    searchHangerInfoResponse response = service.searchHangerInfo(search);
                    return(response);
                }
                catch
                {
                    logger.Error($"web service can not get data: {site}-{hangerId}");
                    searchHangerInfoResponse response = new searchHangerInfoResponse();
                    var returnValue = new hangerInfoResponse();
                    returnValue.sfc               = "";
                    returnValue.partId            = "";
                    returnValue.site              = "";
                    returnValue.statusDescription = "数据异常";
                    response.@return              = returnValue;
                    return(response);
                }
            }
        }
 /// <remarks/>
 public void searchHangerInfoAsync(searchHangerInfo searchHangerInfo1)
 {
     this.searchHangerInfoAsync(searchHangerInfo1, null);
 }
 /// <remarks/>
 public System.IAsyncResult BeginsearchHangerInfo(searchHangerInfo searchHangerInfo1, System.AsyncCallback callback, object asyncState)
 {
     return(this.BeginInvoke("searchHangerInfo", new object[] {
         searchHangerInfo1
     }, callback, asyncState));
 }