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>();
}