MaxProtocolVersion错误 - 适用于Microsoft的SAP Gateway [英] MaxProtocolVersion error - SAP Gateway for Microsoft
问题描述
执行以下代码后,我收到以下错误。 serviceContext将MaxProtocolVersion作为只读返回。如何修改MaxProtocolVersion并解决此问题。
ServiceDetails serviceDetail = ConfigurationReaderHandler.Instance.GetServiceDetails(" ZPURCHASE_ORDER_SRV" );
serviceContext = new ZPURCHASE_ORDER_SRV(new Uri(serviceDetail.Url));
serviceContext.AddAndUpdateResponsePreference = DataServiceResponsePreference.IncludeContent; // error
// data fill - poItem
serviceContext.AddObject(" ZPURCHASE_ORDER_SRV",poItem);
DataServiceResponse response = serviceContext.SaveChanges();
错误:
请求需要使用该版本的3.0协议,但数据服务上下文的MaxProtocolVersion设置为2.0。将MaxProtocolVersion设置为更高版本,然后重试该操作。
您好Anandhan,
您需要添加名为 Microsoft的程序集。 Data.Services.Client.dll获取3.0版功能。
您可以手动替换程序集引用,甚至可以更好地安装WCF数据服务5.0安装程序应更新添加服务引用中的Visual Studio组件以按预期使用版本3.0功能。
https://www.microsoft.com/en-us/download/details.aspx ?id = 29306
最诚挚的问候,
Victoria 跨度> 跨度>
Hi,
I'm receiving the following error after executing the following code. serviceContext returns MaxProtocolVersion as read only. How to modify MaxProtocolVersion and resolve this issue.
ServiceDetails serviceDetail = ConfigurationReaderHandler.Instance.GetServiceDetails("ZPURCHASE_ORDER_SRV"); serviceContext = new ZPURCHASE_ORDER_SRV(new Uri(serviceDetail.Url)); serviceContext.AddAndUpdateResponsePreference = DataServiceResponsePreference.IncludeContent;//error //data fill - poItem serviceContext.AddObject("ZPURCHASE_ORDER_SRV", poItem); DataServiceResponse response = serviceContext.SaveChanges();
Error:
The
request requires that version 3.0 of the protocol be used, but the MaxProtocolVersion of the data service context is set to 2.0. Set the MaxProtocolVersion to the higher version, and then retry the operation.
Hi Anandhan,
You need to add assembly called Microsoft.Data.Services.Client.dll to get the version 3.0 features.
You can either manually replace the assembly references, or even better install the WCF Data Services 5.0 setup which should update the Visual Studio components inside Add Service Reference to work with version 3.0 features as expected.
https://www.microsoft.com/en-us/download/details.aspx?id=29306
Best Regards,
Victoria
这篇关于MaxProtocolVersion错误 - 适用于Microsoft的SAP Gateway的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!