我需要能够使用Asp.Net Core 2.0中的自定义绑定在客户端中发送授权。它可以在Asp.net 4.6.1中工作,而不能在Core 2.2中工作。我正在尝试连接到我们租户中的Workday公用Web服务。由于我能够在Asp.Net 4.6.1中进行此工作,因此我在此完成了开发,但希望为将来的可能发展弄清楚。
我创建了我在代码中使用的自定义绑定。参见下文,但是,我总是收到此错误:完整消息:
System.PlatformNotSupportedException:不支持TransportSecurityBindingElement.BuildChannelFactoryCore。
我在Asp.Net Core 2.0 MVC中的实现:
public async Task<bool> ImportTimeEntryBlockAsync(TimeEntry item)
{
bool isValid = true;
//Create the update object to update the webservice
//setup Header
Workday_Common_HeaderType header = new Workday_Common_HeaderType
{
Include_Reference_Descriptors_In_Response = true
};
//setup reported time block data from item
Reported_Time_Block_DataType timeBlockData = new Reported_Time_Block_DataType();
PopulateTimeBlock(item, ref timeBlockData);
Reported_Time_Block_DataType[] timeBlocks = new Reported_Time_Block_DataType[1];
timeBlocks[0] = timeBlockData;
//setup import reported time block request
Import_Reported_Time_Blocks_RequestType request = new Import_Reported_Time_Blocks_RequestType
{
version = "v29.0", …Run Code Online (Sandbox Code Playgroud)