public void XmlInvokeFooComplex() { ITestServiceXml ts = CreateChannel <ITestServiceXml> ( delegate(Message input) { // Test input for in and ref args. XmlDocument doc = new XmlDocument(); doc.LoadXml(input.ToString()); XmlNamespaceManager nss = new XmlNamespaceManager(doc.NameTable); nss.AddNamespace("s", "http://www.w3.org/2003/05/soap-envelope"); nss.AddNamespace("t", "http://tempuri.org/"); XmlElement el = doc.SelectSingleNode("/s:Envelope/s:Body/t:FooComplex", nss) as XmlElement; Assert.IsNotNull(el, "I#0"); XmlElement arg1 = el.SelectSingleNode("t:arg1", nss) as XmlElement; Assert.IsNotNull(arg1, "I#2"); Assert.AreEqual("testIt", arg1.GetAttribute("val"), "I#3"); return(ToMessage(input, true, new FooComplexResponse("callResult"))); } ); TestData res = ts.FooComplex(new TestData("testIt")); Assert.IsNotNull(res, "#1"); Assert.AreEqual("callResult", res.val, "#2"); }
public void XmlInvokeFooComplexMC() { ITestServiceXml ts = CreateFooComplexMC_Channel <ITestServiceXml> (true); TestResult res = ts.FooComplexMC(new TestMessage("testIt", "testMsg")); Assert.IsNotNull(res, "#1"); Assert.AreEqual("callResult", res.resData.val, "#2"); Assert.AreEqual("callArg", res.resMsg.val, "#3"); }
public void XmlInvokeVoidFooOutParam() { ITestServiceXml ts = CreateVoidFooOutParamChannel <ITestServiceXml> (true); string argRef = "testRef"; string argOut; ts.VoidFooOutParam("testIt", ref argRef, out argOut); Assert.AreEqual("refArg", argRef, "#1"); Assert.AreEqual("outArg", argOut, "#2"); }