예제 #1
0
        public bulkExecuteResponse bulkExecute(bulkExecute request)
        {
            string debt = "";

            try
            {
                //init data
                WinFormsTest.nci.bulkExecuteRequest nciex = new WinFormsTest.nci.bulkExecuteRequest();

                int count = 0;
                nciex.bulkExecute = new WinFormsTest.nci.ExecuteRequest[request.executeRequest.Length];
                foreach (ExecuteRequest exect in request.executeRequest)
                {
                    WinFormsTest.nci.Parameter[] prs = new WinFormsTest.nci.Parameter[exect.parameter.Length];

                    int countpa = 0;
                    foreach (Parameter param in exect.parameter)
                    {
                        prs[count]       = new WinFormsTest.nci.Parameter();
                        prs[count].key   = param.key;//"abonentCode";
                        prs[count].value = param.value;
                        countpa++;
                    }
                    WinFormsTest.nci.ExecuteRequest nciexect = new WinFormsTest.nci.ExecuteRequest();
                    nciexect.parameter = prs;
                    nciexect.serviceId = exect.serviceId;


                    nciex.bulkExecute[count] = nciexect;
                    count++;
                }



                //   WinFormsTest.nci.NCIServiceWCFClient ee = UCCProxyFactory.CreateNCIServiceClient(new Uri("http://localhost:8089/nci/NCIServiceWCFBean"));
                WinFormsTest.nci.NCIServiceWCFClient ee = UCCProxyFactory.CreateNCIServiceClient(new Uri("http://92.241.79.133:8080/nci/NCIServiceWCFBean"));
                //nci.NCIServiceWCFClient ee = UCCProxyFactory.CreateNCIServiceClient(new Uri("http://10.87.12.181:7000/ExternalServices/UCCNCIService"));
                WinFormsTest.nci.ExecuteResult[] resp;

                bulkExecuteResponse rtn = new bulkExecuteResponse();
                //execute
                try
                {
                    resp = ee.bulkExecute(nciex.bulkExecute);
                }
                catch (Exception exc)
                {
                    //System.Diagnostics.Debug.WriteLine(exc.Message)
                    return(null);
                }

                return(rtn);
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex.Message);
            }

            return(null);
        }
예제 #2
0
        public executeResponse execute(execute request)
        {
            string debt = "";

            try
            {
                //init data
                WinFormsTest.nci.execute     ex  = new WinFormsTest.nci.execute();
                WinFormsTest.nci.Parameter[] prs = new WinFormsTest.nci.Parameter[request.parameter.Length];
                int count = 0;
                foreach (Parameter param in request.parameter)
                {
                    prs[count]       = new WinFormsTest.nci.Parameter();
                    prs[count].key   = param.key;//"abonentCode";
                    prs[count].value = param.value;
                    count++;
                }

                ex.parameter = prs;
                ex.serviceId = request.serviceId;

                // WinFormsTest.nci.NCIServiceWCFClient ee = UCCProxyFactory.CreateNCIServiceClient(new Uri("http://0330X395:8089/nci/NCIServiceWCFBean"));
                WinFormsTest.nci.NCIServiceWCFClient ee = UCCProxyFactory.CreateNCIServiceClient(new Uri("http://92.241.79.133:8080/nci/NCIServiceWCFBean"));
                //nci.NCIServiceWCFClient ee = UCCProxyFactory.CreateNCIServiceClient(new Uri("http://10.87.12.181:7000/ExternalServices/UCCNCIService"));
                WinFormsTest.nci.executeResponse resp = new WinFormsTest.nci.executeResponse();

                executeResponse rtn = new executeResponse();
                //execute
                try
                {
                    resp = ee.execute(ex);



                    StringBuilder sb = new StringBuilder();

                    if (resp.outParameter != null)
                    {
                        rtn.outParameter = new Parameter[resp.outParameter.Length];
                        count            = 0;
                        foreach (WinFormsTest.nci.Parameter param in resp.outParameter)
                        {
                            //System.Diagnostics.Trace.WriteLine(param.key + " " + param.value);
                            rtn.outParameter[count]       = new Parameter();
                            rtn.outParameter[count].key   = param.key;
                            rtn.outParameter[count].value = param.value;
                            sb.AppendFormat("{0}={1}\r\n", param.key, param.value);
                            count++;
                        }
                    }

                    if (resp.faultEntry != null)
                    {
                        rtn.faultEntry = new FaultEntry[resp.faultEntry.Length];
                        count          = 0;
                        foreach (WinFormsTest.nci.FaultEntry fe in resp.faultEntry)
                        {
                            //System.Diagnostics.Trace.WriteLine(param.key + " " + param.value);
                            rtn.faultEntry[count]                  = new FaultEntry();
                            rtn.faultEntry[count].errorKey         = fe.errorKey;
                            rtn.faultEntry[count].invalidParameter = fe.invalidParameter;
                            rtn.faultEntry[count].errorParameters  = fe.errorParameters;
                            sb.AppendFormat("{0}={1}\r\n", "error", fe.errorKey);
                            count++;
                        }
                    }
                }
                catch (Exception exc)
                {
                    //System.Diagnostics.Debug.WriteLine(exc.Message)
                    return(null);
                }

                return(rtn);
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex.Message);
            }

            return(null);
        }