public void InvokeFooOutEnumParam() { ITestService ts = CreateChannel <ITestService> ( delegate(Message input) { // Test input for in and out Enum 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:FooOutEnumParam", nss) as XmlElement; Assert.IsNotNull(el, "I#0"); XmlNode arg1 = el.SelectSingleNode("t:arg1", nss); Assert.IsNotNull(arg1, "I#2"); Assert.AreEqual("Blue", arg1.InnerText, "I#3"); return(ToMessage(input, false, new FooOutEnumParamResponse(FooColor.Green, FooColor.Red))); } ); FooColor argOut; FooColor res = ts.FooOutEnumParam(FooColor.Blue, out argOut); Assert.AreEqual(FooColor.Green, res, "#1"); Assert.AreEqual(FooColor.Red, argOut, "#2"); }
public FooOutEnumParamResponse(FooColor ret, FooColor outArg) { FooOutEnumParamResult = ret; this.arg2 = outArg; }