无法在Visual Studio中添加服务引用

时间:2013-03-15 13:15:33

标签: c# web-services visual-studio-2008

我遇到了服务问题。

所以基本上我有一个webproject,我想在服务中添加一些外部引用,但在尝试添加它时,或者当我尝试发现(通过单击GO)时,我收到错误:

The HTML document does not contain Web service discovery information.
Metadata contains a reference that cannot be resolved: 'http://webadress:port/wsdl/authentication-service.wsdl'.
The content type text/html of the response message does not match the content type of the binding (application/soap+xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 1024 bytes of the response were: '<?xml version="1.0" encoding="UTF-8"?>

<wsdl:definitions name="authentication-service"
   targetNamespace="http://www.alfresco.org/ws/service/authentication/1.0" 
   xmlns:apachesoap="http://xml.apache.org/xml-soap" 
   xmlns:auth="http://www.alfresco.org/ws/service/authentication/1.0" 
   xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
   xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" 
   xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <!-- ************************************** -->
   <!-- Copyright Alfresco Software, Inc. 2005 -->
   <!-- ************************************** -->
   <wsdl:types>
      <schema elementFormDefault="qualified" targetNamespace="http://www.alfresco.org/ws/service/authentication/1.0" xmlns="http://www.w3.org/2001/XMLSchema">
         <element name="startSession">
            <complexType>
               <sequence>
                  <element name="fa" type="xsd:string"/>
                  <element name="fp" type="xsd:string"/>
             '.
If the service is defined in the current solution, try building the solution and adding the service reference again.

基本上我不知道我应该知道什么,我怎么才能访问该服务,最好的方法是什么,为什么我不能在VS中引用该服务?

引用是这样的:http://webadress:port/wsdl/authentication-service.wsdl(它是外部服务,不是我的或任何东西)

当我在浏览器中打开此URL时,我确实会看到一个有效的xml ....

随时欢迎任何想法

1 个答案:

答案 0 :(得分:2)

我曾经在添加外部api引用时遇到类似的问题,有时它使用wsdl工具生成代理类。你可以尝试一下