添加服务参考 [英] Add Service Reference

查看:85
本文介绍了添加服务参考的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我在vs-2010中使用 项目服务器2010为pwa网站添加了一些网络服务参考。


在应用程序中添加Web服务引用时会出现一些错误,例如..



'http:// devastro / pwa / _vti_bin /psi/project.asmx'。

请求失败,HTTP状态为400:错误请求。

元数据包含无法解析的引用:'http:// devastro /pwa/_vti_bin/psi/project.asmx'。

HTTP请求未经授权,客户端身份验证方案为"匿名"。从服务器收到的身份验证标头是"NTLM"。

远程服务器返回错误:(401)未经授权。

如果在当前解决方案中定义了服务,尝试构建解决方案并再次添加服务引用。


如何删除此错误...............



Neeraj

解决方案

嗨Neeraj,


如果要使用WCF,则需要创建代理程序集文件。您可以按照本文中的步骤进行操作:  http://msdn.microsoft.com/en-us/ library / ff621594.aspx


如果您想使用ASMX,就像使用PS 2007一样,只需在您的VS项目中添加Web引用添加服务参考>高级>添加网络参考并使用"?wsdl "键入您的网络服务网址最后:http://devastro/pwa/_vti_bin/psi/project.asmx ?wsdl


问候,


< p style ="text-align:left">


克莱门特


Hi everyone,

I am adding some web service reference in vs-2010  using  project server 2010,for pwa site.

When adding web service reference in application give some error like..

'http://devastro/pwa/_vti_bin/psi/project.asmx'.
The request failed with HTTP status 400: Bad Request.
Metadata contains a reference that cannot be resolved: 'http://devastro/pwa/_vti_bin/psi/project.asmx'.
The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'NTLM'.
The remote server returned an error: (401) Unauthorized.
If the service is defined in the current solution, try building the solution and adding the service reference again.

How to remove this error...............


Neeraj

解决方案

Hi Neeraj,

If you want to use WCF, you'll need create proxy assembly files. You can follow steps in this article : http://msdn.microsoft.com/en-us/library/ff621594.aspx.

If you want to use ASMX, as it was with PS 2007, just add a web reference to your VS project Add Service Reference > Advanced > Add Web Reference and type your web service url with "?wsdl" at the end : http://devastro/pwa/_vti_bin/psi/project.asmx?wsdl

Regards,

Clement


这篇关于添加服务参考的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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