Example #1
0
 public override async Task <CollectionsResponse> GetCollections(CollectionsRequest request, ServerCallContext context)
 {
     return(new CollectionsResponse()
     {
         Collections = { (await this.cache.GetCollectionsAsync(request.Id, context.CancellationToken)).Select(x => x.ToGrpc()).ToArray() }
     });
 }
Example #2
0
        /// <summary>
        /// Calls the ASMX service using WCF.
        /// </summary>
        public static void AsmxCallsUsingWcf()
        {
            TestAsmxServiceSoapClient asmxClient = new TestAsmxServiceSoapClient("TestAsmxServiceSoap");
            SimpleAsmxRequest         request    = new SimpleAsmxRequest();

            request.A = 99;
            request.B = "hello";
            request.OptionalSpecified = false;
            asmxClient.ProcessSimpleAsmxRequestWrapped(request);
            asmxClient.ProcessSimpleAsmxRequestBare(request);
            asmxClient.ProcessMultipleParametersWrapped(99, "hello");

            asmxClient = new TestAsmxServiceSoapClient("TestAsmxServiceSoap12");
            asmxClient.ProcessSimpleAsmxRequestWrapped(request);
            asmxClient.ProcessSimpleAsmxRequestBare(request);
            asmxClient.ProcessMultipleParametersWrapped(99, "hello");

            asmxClient.WithNullableInt(null);
            asmxClient.WithNullableInt(1);

            asmxClient.SimpleTypes(1, GeneratedContractsAsmx.ConsoleColor.Black, "a", 1.1m, DateTime.Now, Guid.NewGuid(), System.Xml.XmlQualifiedName.Empty);

            asmxClient.ScalarArray(new int[] { 0, 1, 2 });

            XmlAsmxRequest data = new XmlAsmxRequest();
            XmlDocument    xmle = new XmlDocument();

            xmle.LoadXml("<test xmlns=\"\">Element</test>");
            data.Element = xmle.DocumentElement;
            data.Nodes   = new System.Xml.XmlNode[2];
            XmlDocument xmln1 = new XmlDocument();

            xmln1.LoadXml("<test xmlns=\"\"><node>one</node></test>");
            data.Nodes[0] = xmln1.DocumentElement;
            XmlDocument xmln2 = new XmlDocument();

            xmln2.LoadXml("<test xmlns=\"\"><node>two</node></test>");
            data.Nodes[1] = xmln2.DocumentElement;

            asmxClient.XmlRequestMethod(data);

            CollectionsRequest cr = new CollectionsRequest();

            cr.ArrayList = new object[] { 1, "hello" };

            cr.IntList = new int[] { 0, 1, 2 };

            cr.RequestList    = new SimpleAsmxRequest[1];
            cr.RequestList[0] = new SimpleAsmxRequest();

            cr.RequestCollection    = new SimpleAsmxRequest[1];
            cr.RequestCollection[0] = new SimpleAsmxRequest();

            cr.NonGenericEnumerableOnlyCollection = new object[] { "hello", 1 };

            asmxClient.CollectionMethod(cr);

            AsmxCircle shape = new AsmxCircle();

            asmxClient.ProcessShape(shape);

            DataSet ds = CreateTestDataSet();

            asmxClient.ProcessDataSet(ds);
            asmxClient.ProcessDataSetWithMoreData(ds, 1);
            AsmxCompoundWithDataSet compoundWithDataSet = new AsmxCompoundWithDataSet();

            compoundWithDataSet.Data = ds;
            asmxClient.ProcessCompoundDataSet(compoundWithDataSet);
            asmxClient.ProcessTypedDataSet(CreateTestAsmxTypedDataSet());
            AsmxCompoundWithTypedDataSet compoundWithTypedDataSet = new AsmxCompoundWithTypedDataSet();

            compoundWithTypedDataSet.Data = CreateTestAsmxTypedDataSet();
            asmxClient.ProcessCompoundTypedDataSet(compoundWithTypedDataSet);
        }