OData默认公司,并在MS Visual Studio 2013中构建的Silverlight应用程序中调整服务配置文件 [英] OData Default company and adjusting Service Config Files in Silverlight App being built in MS Visual Studio 2013

查看:98
本文介绍了OData默认公司,并在MS Visual Studio 2013中构建的Silverlight应用程序中调整服务配置文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用MS Visual Studio 2013构建Lightswitch应用程序.作为此过程的一部分,我通过OData URL(引用动态导航项目)访问数据,该URL似乎不想在该URL中获取公司数据. (它没有它).但是,然后在Visual Studio中,我只能看到列标题,而没有数据.调试时收到以下错误消息:

I'm building a Lightswitch application using MS Visual Studio 2013. As part of this I access data through an OData url (referencing a dynamics nav project) which does not seem to want to pick up the company data in the url. (It does without it). However then within Visual Studio I only see the column headers and no data. When I debug I get the following error message:

无法处理该请求,因为找不到默认的Microsoft Dynamics导航公司.您可以在服务配置文件中指定一个默认公司,或者为每个租户指定一个公司,或者可以以"的形式添加查询字符串company = [name]".您可以通过访问默认的OData Web服务Company(公司)来查看可用的公司.有关更多信息,请参见帮助"中的"OData Web Services".

"Cannot process the request because the default Microsoft Dynamics NAV company cannot be found. You can specify a default company in the service configuration file, or specify one for each tenant, or you can add a query string in the form of "company=[name]". You can see the available companies by accessing the default OData web service, Company. For more information, see "OData Web Services" in Help."

例如:(OData url): 本地主机:7048/DynamicsNAV70/OData/Company('CRONUS%20International%20Ltd.')/SalesOrder

For example: (OData url): localhost:7048/DynamicsNAV70/OData/Company('CRONUS%20International%20Ltd.')/SalesOrder

但只能通过以下方式查看: 本地主机:7048/DynamicsNAV70/OData/,然后选择SalesOrder

But only viewable as: localhost:7048/DynamicsNAV70/OData/ and then selecting SalesOrder

我的问题是,它们指的是什么配置文件? (Visual Studio?如果是,如何添加公司名称?)""没有用.

My question is, what config files are they refering to? (Visual studio?If so how do I add the company name?) "OData Web Services" in Help was of no use.

推荐答案

我必须在Visual Studio中添加其他代码来引用公司,例如:

I had to add additional code within Visual Studio to reference the company, for example:

ServiceReference1.NAV导航=新ServiceReference1.NAV(新Uri("http:.../OData/Company('company_name')/"));

ServiceReference1.NAV nav = new ServiceReference1.NAV(new Uri("http:...../OData/Company('company_name')/"));

nav.Credentials =新的System.Net.NetworkCredential(用户",密码",域");

nav.Credentials = new System.Net.NetworkCredential("user", "password", "domain");

这篇关于OData默认公司,并在MS Visual Studio 2013中构建的Silverlight应用程序中调整服务配置文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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