简体   繁体   English

为WCF数据服务客户端生成System.ServiceModel配置部分

[英]Generating the System.ServiceModel configuration section for WCF Data Service client

When I use the "Add Service Reference" utility in Visual Studio to connect to a WCF Data Service (OData), visual Studio doesn't generate an App.config file with the System.ServiceModel section for me. 当我在Visual Studio中使用“添加服务引用”实用程序连接到WCF数据服务(OData)时,Visual Studio不会为我生成带有System.ServiceModel部分的App.config文件。 (The proxy class is generated fine). (代理类生成良好)。 Is this normal? 这正常吗?

Is there still a way to have this config generated automatically? 还有没有办法自动生成此配置? The WCF service in question is secured and I therefore struggle with authentication issues if I try to to use the command line svcutil.exe with the /config option. 有问题的WCF服务是安全的,因此,如果我尝试将命令行svcutil.exe与/ config选项一起使用,我将遇到身份验证问题。

svcutil.exe cannot be used with WCF Data Services (OData), there's a datasvcutil.exe which is used instead. svcutil.exe不能与WCF数据服务(OData)一起使用,而是使用datasvcutil.exe代替。

The Add Service Reference for OData should not generate anything into your app.config as it doesn't need it. OData的添加服务参考不应在您的app.config中生成任何内容,因为它不需要它。 To use it, you just new up the generated context class and pass in the URI of the service. 要使用它,您只需新建生成的上下文类,然后传入服务的URI。

If your OData endpoint required authentication though, the Add Service Reference doesn't support that though, so I'm surprised it works for you. 但是,如果您的OData终结点需要身份验证,则“添加服务参考”不支持该身份验证,因此我感到惊讶的是它对您有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法读取配置节“ system.ServiceModel”,缺少节声明 - The configuration section 'system.ServiceModel' cannot be read, missing section declaration 使用ConfigurationManager加载System.ServiceModel配置节 - Loading System.ServiceModel configuration section using ConfigurationManager 部署WCF客户端时出错 - 在SQL Catalog中找不到&#39;system.servicemodel&#39; - Error deploying WCF Client - 'system.servicemodel was not found in SQL Catalog' 如何从类库中读取“ System.ServiceModel”配置节组? - How do I read the “System.ServiceModel” configuration section group from a class library? 如何使用WCF服务的代理实现读取类库中的System.serviceModel - How to read System.serviceModel in Class Library with Proxy implementation of WCF service 使用System.ServiceModel在Xamarin中使用WCF REST基本身份验证服务 - Consume WCF REST basic auth service in Xamarin using System.ServiceModel System.ServiceModel引用 - System.ServiceModel References System.ServiceModel消失 - System.ServiceModel disappear System.ServiceModel缺失 - System.ServiceModel missing 为什么是<system.servicemodel> app.config 中缺少部分?</system.servicemodel> - Why is the <system.serviceModel> section missing from app.config?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM