dontcore 调用 金蝶Webservice 设置SoapHeader

  
using (var scope = new OperationContextScope(jindieYwService.InnerChannel))
  {
// 设置SoapHeader 的SessionId
      MessageHeader messageHeader = MessageHeader.CreateHeader("SessionId",  "http://login.webservice.bos.kingdee.com", _sessionId, false);
      OperationContext.Current.OutgoingMessageHeaders.Add(messageHeader);
//调用方法
      var rs = await jindieYwService.getDataAsync(new  JinDieYWServiceReference.getDataRequest { jkNumber = jkNumber, json = req      });
      Serilog.Log.Information(jkNumber+" resp :" + rs.getDataReturn);
      return rs.getDataReturn.ToObject<T>();
  }
posted @ 2024-08-01 15:15  三岔路  阅读(8)  评论(0编辑  收藏  举报