当前位置: 首页>>代码示例>>C#>>正文


C# ServiceClient.CallService方法代码示例

本文整理汇总了C#中ServiceClient.CallService方法的典型用法代码示例。如果您正苦于以下问题:C# ServiceClient.CallService方法的具体用法?C# ServiceClient.CallService怎么用?C# ServiceClient.CallService使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ServiceClient的用法示例。


在下文中一共展示了ServiceClient.CallService方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: S09_WFGL_CXSLXX

        //public Tuple<VO_SYS_HEAD, VO_WF_SLXXX, VO_WF_SLXXX[]> WFGL_CXSLXXA(VO_WF_SLXXX vo_WF_SLXX)
        //{
        //    var client = new ServiceClient();
        //    var sysHead = new VO_SYS_HEAD(0,String.Empty);
        //    sysHead.IsSysHead = true;
        //    var result = client.CallService<VO_SYS_HEAD, VO_WF_SLXXX, VO_WF_SLXXX>(ServicePrifix + MethodBase.GetCurrentMethod().Name, sysHead, vo_WF_SLXX);
        //    return new Tuple<VO_SYS_HEAD, VO_WF_SLXXX,VO_WF_SLXXX[]>(result.Item1,result.Item2,result.Item3);
        //}
        public Tuple<VOX_SYS_HEAD, VOX_SYS_ERROR, VO_WF_SLXX[]> S09_WFGL_CXSLXX(VO_WF_SLXX vo_WF_SLXX)
        {
            var client = new ServiceClient();
            var sysHead = new VOX_SYS_HEAD(0, String.Empty,true);
            var result = client.CallService<VOX_SYS_HEAD, VOX_SYS_ERROR, VO_WF_SLXX>(ServicePrifix + MethodBase.GetCurrentMethod().Name, sysHead, vo_WF_SLXX);

            return new Tuple<VOX_SYS_HEAD, VOX_SYS_ERROR, VO_WF_SLXX[]>(result.Item1, result.Item2, result.Item3);
        }
开发者ID:wxanywhere,项目名称:WX_DEMO,代码行数:16,代码来源:S_GZLGL.cs

示例2: XTGL_CXWGNCZY

        public Tuple<VOX_SYS_HEAD, VOX_SYS_ERROR, VO_WF_CZYB[]> XTGL_CXWGNCZY(VO_WF_CZQX vo_WF_CZQX)
        {
            var client = new ServiceClient();
              var sysHead = new VOX_SYS_HEAD(0, String.Empty, true);
              var result = client.CallService<VOX_SYS_HEAD, VOX_SYS_ERROR, VO_WF_CZYB>(ServicePrifix + MethodBase.GetCurrentMethod().Name, sysHead, vo_WF_CZQX);

              return result;
        }
开发者ID:wxanywhere,项目名称:WX_DEMO,代码行数:8,代码来源:S_XTGL.cs

示例3: XTGL_CXDLCZY

        public Tuple<VOX_SYS_HEAD, VOX_SYS_ERROR, VO_WF_CZYB> XTGL_CXDLCZY(VO_WF_CZYB vo_WF_CZYB)
        {
            var client = new ServiceClient();
              var sysHead = new VOX_SYS_HEAD(0, String.Empty, true);
              var result = client.CallService<VOX_SYS_HEAD, VOX_SYS_ERROR, VO_WF_CZYB>(ServicePrifix + MethodBase.GetCurrentMethod().Name, sysHead, vo_WF_CZYB);

              return new Tuple<VOX_SYS_HEAD, VOX_SYS_ERROR, VO_WF_CZYB>(result.Item1, result.Item2, result.Item3 != null ? result.Item3[0] : null);
        }
开发者ID:wxanywhere,项目名称:WX_DEMO,代码行数:8,代码来源:S_XTGL.cs

示例4: WFGL_CXLZXX

 public Tuple<VOX_SYS_HEAD, VOX_SYS_ERROR, VO_WF_LZXX[]> WFGL_CXLZXX(VO_WF_LZXX vo_WF_LZXX)
 {
     var client = new ServiceClient();
     var sysHead = new VOX_SYS_HEAD(0, "", true);
     String ServicePrifix = "WF.WFGL.";
     var svcName = ServicePrifix + MethodBase.GetCurrentMethod().Name;
     var result = client.CallService<VOX_SYS_HEAD, VOX_SYS_ERROR, VO_WF_LZXX>(svcName, sysHead, vo_WF_LZXX);
     return result;
 }
开发者ID:wxanywhere,项目名称:WX_DEMO,代码行数:9,代码来源:S_GZLGL.cs

示例5: WFDY_CXLCDY_IDPC

        public Tuple<VO_SYS_HEAD, VOX_SYS_ERROR, VO_WF_GZLDY[]> WFDY_CXLCDY_IDPC(VO_WF_GZLDY vo_WF_SLXX)
        {
            var client = new ServiceClient(PackingProviderType.ValuePackingProvider, "OP_CODE");
            var sysHead = new VO_SYS_HEAD(true);
            var sysSvc = new VO_SYS_SVC(true);
            var svcName = "IDP.WF.WFDY_CXLCDY";  //ServicePrifix + MethodBase.GetCurrentMethod().Name;
            sysSvc.SVC_NAME = svcName;
            var result = client.CallService<VO_SYS_HEAD, VOX_SYS_ERROR, VO_WF_GZLDY>(svcName, sysHead, sysSvc, vo_WF_SLXX);

            return result;
        }
开发者ID:wxanywhere,项目名称:WX_DEMO,代码行数:11,代码来源:S_GZLGL.cs

示例6: CheckOrderStatus

        private static bool CheckOrderStatus(
            ServiceClient<IFulfillmentService> client,
            Guid orderId)
        {
            Confirmation confirmation = null;
            try
            {
                confirmation = client.CallService(
                    "BasicHttpBinding_IFulfillmentService",
                    s => s.CheckOrderStatus(orderId));
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
                return false;
            }

            if (confirmation == null)
                return false;

            PrintConfirmation(confirmation);
            return true;
        }
开发者ID:ahmedomarjee,项目名称:PharmaNet,代码行数:23,代码来源:Program.cs

示例7: PlaceOrder

 private static void PlaceOrder(
     ServiceClient<IFulfillmentService> client,
     Order order)
 {
     while (true)
     {
         try
         {
             client.CallService(
                 "BasicHttpBinding_IFulfillmentService",
                 s => s.PlaceOrder(order));
             return;
         }
         catch (Exception ex)
         {
             Console.WriteLine("Network error: retry.");
         }
     }
 }
开发者ID:ahmedomarjee,项目名称:PharmaNet,代码行数:19,代码来源:Program.cs

示例8: WFGL_SLCL

 public Tuple<VOX_SYS_HEAD, VOX_SYS_ERROR, VO_WF_SLXX> WFGL_SLCL(VO_WF_CZRZ vo_WF_CZRZ, VO_WF_SLXX vo_WF_SLXX, VO_WF_GZLHD vo_WF_GZLHD, VO_WF_LZSXW vo_WF_LZSXW)
 {
     var client = new ServiceClient();
     var sysHead = new VOX_SYS_HEAD(0, "", true);
     String ServicePrifix = "WF.WFGL.";
     var svcName = ServicePrifix + MethodBase.GetCurrentMethod().Name;
     var result = client.CallService<VOX_SYS_HEAD, VOX_SYS_ERROR, VO_WF_SLXX>(svcName, sysHead, vo_WF_CZRZ,vo_WF_SLXX,vo_WF_GZLHD,vo_WF_LZSXW);
     if (result.Item3.Length > 0)
         return new Tuple<VOX_SYS_HEAD, VOX_SYS_ERROR, VO_WF_SLXX>(result.Item1, result.Item2, result.Item3[0]);
     else
         return null;
 }
开发者ID:wxanywhere,项目名称:WX_DEMO,代码行数:12,代码来源:S_GZLGL.cs

示例9: Main

        static void Main(string[] args)
        {
            //NLog.Config.SimpleConfigurator.ConfigureForConsoleLogging(LogLevel.Info);

            try
            {
                ConfigExample.Test();
                //OracleTests.TestBasicOps();
                //OracleTests.TestDbInit();
                //OracleTests.TestSend();
                OracleTests.TestNamedQ();
                OracleTests.TestQueueOps();
                //Console.ReadLine();
                //return;
                //MongoQueue.Test1();
                //MongoQueue.TestSer();
                //MongoQueue.Test2();
                //MongoQueue.TestSagas();
                //return;
                //DelegateTest();
                //PerfTest.SendTest();
                //Console.ReadLine();
                //return;
                //SerializationTests.Test4();
                //SerializationTests.Test3();
                //turn;
                //CacheTest();
                //TransactionTest.Test1("Data Source=(local);Initial Catalog=NGinn;User Id=nginn;Password=PASS");
                //TransactionTest.Test2("Data Source=(local);Initial Catalog=NGinn;User Id=nginn;Password=PASS");
                //TransactionTest.Test3("Data Source=(local);Initial Catalog=NGinn;User Id=nginn;Password=PASS");

                //return;
                ///configure perf counters - just to see the stats in log
                //NGinnBPM.MessageBus.Perf.DefaultCounters.ConfigureFromFile("PerfCounters.xml");
                ///Map database alias to database connection string, so then you can use
                ///the alias when referring to a queue: e.g. sql://testdb1/Queue1
                Dictionary<string, string> connStrings = new Dictionary<string,string>();
                 ///configure two containers with two message buses
                IWindsorContainer wc1 = ConfigureMessageBus("sql://testdb1/MQueue4", connStrings, null);

                //IWindsorContainer wc2 = ConfigureMessageBus("sql://testdb2/MQueue2", connStrings, null);

                IMessageBus mb1 = wc1.Resolve<IMessageBus>();
                string sqid = Guid.NewGuid().ToString();
                for (var o = 0; o < 10000; o++)
                {
                   // mb1.Notify(new TestMessage1 { Id = 100000 + o });
                }
                Console.ReadLine();
                using (var ts = new TransactionScope())
                {
                    var m = new TestMessage1 { Id = 9998 };
                    for (int i = 0; i < 100; i++)
                    {
                        mb1.Notify(m);
                    }
                    ts.Complete();
                }
                Console.WriteLine("Batch sent. Enter");
                Console.ReadLine();
                return;
                using (var ts = new TransactionScope())
                {
                    mb1.Notify(new TestMessage1 { });
                    mb1.Notify(new TestMessage1 { Id = 32423 });
                    mb1.NewMessage(new TestMessage1 { Id = 101 }).InSequence(sqid, 0, 4).Publish();
                    mb1.NewMessage(new TestMessage1 { Id = 103 }).InSequence(sqid, 2, 4).Publish();
                    mb1.NewMessage(new TestMessage1 { Id = 102 }).InSequence(sqid, 1, 4).Publish();
                    mb1.NewMessage(new TestMessage1 { Id = 99 }).SetDeliveryDate(DateTime.Now.AddSeconds(10)).Publish();
                    var m = mb1 as NGinnBPM.MessageBus.Impl.MessageBus;
                    Console.WriteLine("STATE");
                    Console.WriteLine(m.GetCurrentTransactionState());
                    ts.Complete();
                }

                Console.ReadLine();
                SagaTest(wc1);
                Console.ReadLine();
                return;
                //IMessageBus mb2 = wc1.Resolve<IMessageBus>("bus2");

                //IMessageBus mb2 = wc2.Resolve<IMessageBus>();
                //mb1.SubscribeAt("sql://testdb2/MQueue2", typeof(TestMessage1));

                //mb1.NewMessage(new TestMessage1 { Id = 2 }).Send(mb2.Endpoint);

                //using (var ts = new System.Transactions.TransactionScope())
                //{
                //    mb1.NewMessage(new TestMessage1 { Id = 111 })
                //        .SetCorrelationId("123332")
                //        .Publish();
                //    //mb1.Notify(new TestMessage1 { Id = 100 });
                //    //mb1.Send("sql://testdb2/MQueue2", new TestMessage1());
                //    ts.Complete();
                //}
                Console.ReadLine();
                return;
                ServiceClient sc = new ServiceClient();
                sc.BaseUrl = "http://localhost:9013/call/";
                sc.CallService<TestMessage1>(new TestMessage1 { Id = 99 });
//.........这里部分代码省略.........
开发者ID:BrettBailey,项目名称:nginn-messagebus,代码行数:101,代码来源:Program.cs


注:本文中的ServiceClient.CallService方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。