Bot应用程序中的SAP SDK集成(用于消耗OData服务) [英] SAP SDK Integration in Bot Application (For consuming OData service)

查看:89
本文介绍了Bot应用程序中的SAP SDK集成(用于消耗OData服务)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

   

实际上,我想使用Visual Studio和c#在Bot Application中使用sap Odata服务.但是当我尝试开设在线商店时,却出现了这样的异常

无法加载文件或程序集'Microsoft.Data.Edm,版本= 5.7.0.0,区域性=中性,PublicKeyToken = 31bf3856ad364e35"或其依赖项之一.找到的程序集的清单定义与程序集引用不匹配. (来自HRESULT的异常: 0x80131040)"

您能建议我如何在Bot Application中使用SAP OData服务.这是我的代码.

公共静态异步任务OpenOnlineStore(){试试{var client = new SAP.Net.Http.HttpClient(); client.PasswordCredential =新的SAP.Net.Http.PasswordCredential(用户名",密码");字符串语言="; //language = GetLocalSettingsValue(" LanguageKeyServer);; if(string.IsNullOrEmpty(language))language ="EN"; client.DefaultRequestHeaders.Add("langu",语言); client.DefaultRequestHeaders.TryAddWithoutValidation("accept-language","en");//Globals.LanguageKey); client.ShouldHandleXcsrfToken = true; Utility.Store =新的SAP.Data.OData.Online.Store.ODataStore(新的Uri("http://34.196.29.170:8080/com.innovapptive.mworkorder"),新的SAP.Data.OData.Online.Store .ODataStore.StoreOptions(){RequestFormat = SAP.Data.OData.Online.Store.ODataStore.EntityFormat.Xml, MaxReceivedMessageSize = 40485760});等待Utility.Store.OpenAsync(client); } catch(异常例外){}}

谢谢:Akash

    Hi,

Actually i want to use sap Odata service in Bot Application using visual studio and c# . But when i try to open online store so i got exception like this

"Could not load file or assembly 'Microsoft.Data.Edm, Version=5.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)"

Can you suggest me how can i use the SAP OData service in Bot Application. This Is my code.

public static async Task OpenOnlineStore() { try { var client = new SAP.Net.Http.HttpClient(); client.PasswordCredential = new SAP.Net.Http.PasswordCredential("username", "password"); string language = ""; //language = GetLocalSettingsValue("LanguageKeyServer"); if (string.IsNullOrEmpty(language)) language = "EN"; client.DefaultRequestHeaders.Add("langu", language); client.DefaultRequestHeaders.TryAddWithoutValidation("accept-language", "en");//Globals.LanguageKey); client.ShouldHandleXcsrfToken = true; Utility.Store = new SAP.Data.OData.Online.Store.ODataStore(new Uri("http://34.196.29.170:8080/com.innovapptive.mworkorder"), new SAP.Data.OData.Online.Store.ODataStore.StoreOptions() { RequestFormat = SAP.Data.OData.Online.Store.ODataStore.EntityFormat.Xml, MaxReceivedMessageSize = 40485760 }); await Utility.Store.OpenAsync(client); } catch (Exception ex) { } }

Thanks:Akash

推荐答案

您好,Akash,

Hi Akash,

由于您没有针对SmartDevice,所以我已将您的问题从SmartDevice论坛移至Visual Studio的C#论坛.

As you are not targeting a SmartDevice I have moved your question from the SmartDevice forum to the C# forum for Visual Studio.

此致

IoTGirl


这篇关于Bot应用程序中的SAP SDK集成(用于消耗OData服务)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆