public MathTypes.MathResponse Divide(int CustomHeader, MathTypes.MathRequest request) { MathTypes.MathRequestMessage inValue = new MathTypes.MathRequestMessage(); inValue.CustomHeader = CustomHeader; inValue.request = request; MathTypes.MathResponseMessage retVal = ((MathTypes.IMath)(this)).Divide(inValue); return(retVal.response); }
private static void Main(string[] args) { MathTypes.MathRequest req = new MathTypes.MathRequest(); req.x = 23; req.y = 44; MathTypes.MathRequestMessage mreq = new MathTypes.MathRequestMessage(); mreq.request = req; mreq.CustomHeader = 8; MathTypes.MathResponseMessage response; //NetTcpBinding binding = new NetTcpBinding(); //binding.Security.Mode = SecurityMode.Message; //binding.Security.Message.ClientCredentialType = MessageCredentialType.Windows; //binding.Security.Transport.ProtectionLevel = //System.Net.Security.ProtectionLevel.EncryptAndSign; CustomBinding binding = new CustomBinding(); binding.Elements.Add(new TextMessageEncodingBindingElement()); binding.Elements.Add(new TcpTransportBindingElement()); MathTypes.IMath channel = new ChannelFactory <MathTypes.IMath>("CustomBinding_IMath").CreateChannel(); response = channel.Add(mreq); Console.WriteLine("Call via BasicProfileBinding: {0}", response.response.result); Console.ReadKey(true); }
public System.Threading.Tasks.Task <MathTypes.MathResponseMessage> DivideAsync(int CustomHeader, MathTypes.MathRequest request) { MathTypes.MathRequestMessage inValue = new MathTypes.MathRequestMessage(); inValue.CustomHeader = CustomHeader; inValue.request = request; return(((MathTypes.IMath)(this)).DivideAsync(inValue)); }
public MathRequestMessage(int CustomHeader, MathTypes.MathRequest request) { this.CustomHeader = CustomHeader; this.request = request; }