1#
C#在消息投增加配置项IP
  1. var client = new CoreServicesClient();
  2.             using (var scope = new OperationContextScope(client.InnerChannel))
  3.             {
  4.                 MessageHeader header = MessageHeader.CreateHeader("clientip", "http://tempuri.org", clientIp);
  5.                 OperationContext.Current.OutgoingMessageHeaders.Add(header);

  6.                 header = MessageHeader.CreateHeader("token", "http://tempuri.org", uToken);
  7.                 OperationContext.Current.OutgoingMessageHeaders.Add(header);

  8.                 var svcResult = client.AcceptBuy(App.FundCode, fixedBagApp.BankAccountNo, fixedBagApp.AmountOrVol,
  9.                             payType, fixedBagApp.ChargeType, password, reference);
  10.                 client.Close();
  11.                 return Convert(svcResult);
  12.             }
复制代码