using System.Collections.Generic;
using System.Threading.Tasks;
using static Test_RD.DemoWrapper;
public Type Query { get; set; }
public Type Response { get; set; }
public WS_Method MethodName { get; set; }
public static IEnumerable<temp> TestFunctions =>
new temp{Query=typeof(FooQuery), Response=typeof(FooResponse), MethodName=WS_Method.Foo },
new temp{Query=typeof(BarQuery), Response=typeof(BarResponse), MethodName=WS_Method.Bar },
new temp{Query=typeof(FooBarQuery), Response=typeof(FooBarResponse), MethodName=WS_Method.FooBar },
var input = new BarQuery { Bar_Label = "user input", Bar_Ig = 42 };
BarResponse result = Execute<BarQuery, BarResponse>(input);
public static T2 Execute<T1,T2>(T1 param) {
var temp = TestFunctions.Single(x => x.Query == typeof(T1));
var method = typeof(DemoWrapper).GetMethod(temp.MethodName.ToString(), new Type[] { typeof(T1) });
var wsClient = new DemoWrapper();
.Invoke(wsClient, new object[] { param })
public static WebServiceClient WSClient;
public static WebServiceContext Context;
#region Method definition
public FooResponse Foo(FooQuery query)
FooResponse result = null;
public BarResponse Bar(BarQuery query)
public FooBarResponse FooBar(FooBarQuery query)
=> new FooBarResponse { };
public TestResponse Test(TestQuery query)
public EtcResponse Etc(EtcQuery query)
public class WebServiceContext { }
public class WebServiceClient
public TempWrap Foo(object o) => new TempWrap { response = new FooResponse { } };
public FooResponse response { get; set; }
public WebServiceContext CallContext { get; set; }
public FooQuery FooIn { get; set; }
#region Class XYZ Query definition
public string Foo_Label { get; set; }
public int Foo_Ig { get; set; }
public string Bar_Label { get; set; }
public int Bar_Ig { get; set; }
public string FooBar_Label { get; set; }
public int FooBar_Ig { get; set; }
public string Test_Label { get; set; }
public int Test_Ig { get; set; }
public string Etc_Label { get; set; }
public int Etc_Ig { get; set; }
#region Class XYZ Response definition
public string Foo_Label { get; set; }
public int Foo_Ig { get; set; }
public string Bar_Label { get; set; }
public int Bar_Ig { get; set; }
public class FooBarResponse
public string FooBar_Label { get; set; }
public int FooBar_Ig { get; set; }
public class TestResponse
public string Test_Label { get; set; }
public int Test_Ig { get; set; }
public string Etc_Label { get; set; }
public int Etc_Ig { get; set; }