Visual Studio 2010:将服务引用添加到2008生成的wsdl中 [英] Visual Studio 2010: adding a service reference to a 2008 generated wsdl

查看:90
本文介绍了Visual Studio 2010:将服务引用添加到2008生成的wsdl中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

不产生app.config.在我们的团队中,有一个拥有Visual Studio 2008的人,他创建了一个Web服务.

Doesn't produce a app.config . In my team there is a guy who has Visual Studio 2008, he created a webservice.

然后有我,将此Web服务添加到控制台项目中.

Then there is me, adding this webservice to a console project.

添加服务引用不会出现问题,但是不会生成有效的app.config.只是空的

Adding the service reference goes without problems but no valid app.config is generated. It's just empty

<configuration>
</configuration>

当我在服务引用中禁用重用类型"时,它可以工作,但是随后出现一个模棱两可的错误.

When I disable 'reuse types' in my service reference it works but then I get an ambiguous error.

这是一个错误吗?

我发现 Visual Studio可以在添加服务引用" 时不会生成app.config内容,但是那里没有解决方案,所以我想我再次提出了问题.

I found Visual Studio does not generate app.config content when "add service reference" this one, but there is no solution there, so I thought I bump the problem up again.

谢谢

推荐答案

我在Visual Studio 2008中遇到了相同的问题.如果使用添加服务参考..."命令,我会得到不同的结果,或深入研究添加服务参考..." | 高级..." | 添加网络参考...".

I have experienced the same issue with Visual Studio 2008. I find I get different results if I'm using the "Add Service Reference..." command, or digging deeper to "Add Service Reference..." | "Advanced..." | "Add Web Reference...".

但是,仍然可以通过命令行使用久经考验的方法以及对我有用的解决方案:

However, the tried-and-true method--and the solution that worked for me--is still via the command line:

svcutil.exe /language:cs /out:GeneratedProxy.cs /config:app.config http://server/path_to/WebServiceBean?WSDL

应该可以为您提供一个有效的app.config.希望有帮助!

That should give you a working app.config. Hope that helps!

这篇关于Visual Studio 2010:将服务引用添加到2008生成的wsdl中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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