代码之家  ›  专栏  ›  技术社区  ›  TheSoftwareJedi jac

为什么这个WSDL文件会在VS2008中生成一个空的服务代理?

  •  2
  • TheSoftwareJedi jac  · 技术社区  · 16 年前

    为什么 this WSDL file 是否在VS2008中生成空服务代理?

    4 回复  |  直到 16 年前
        1
  •  9
  •   walaa waref    13 年前

    右键单击服务引用、cofigure,取消选中引用的程序集中的重用类型,然后单击OK。尝试更新服务引用。这对我有用!

        2
  •  3
  •   Randolpho    16 年前

    Custom tool warning: There was a validation error on a schema generated during export:
        Source: 
        Line: 144 Column: 12
       Validation Error: Wildcard '##any' allows element 'http://search.yahoo.com/mrss:text', and causes the content model to become ambiguous. A content model must be formed such that during validation of an element information item sequence, the particle contained directly, indirectly or implicitly therein with which to attempt to validate each item in the sequence in turn can be uniquely determined without examining the content or attributes of that item, and without any information about the items in the remainder of the sequence.       
    
    Custom tool warning: Cannot import wsdl:portType
    Detail: An exception was thrown while running a WSDL import extension: System.ServiceModel.Description.XmlSerializerMessageContractImporter
    Error: Cannot import invalid schemas. Compilation on the XmlSchemaSet failed.
    XPath to Error Source: //wsdl:definitions[@targetNamespace='http://fliqz.com/services/search/20071001']/wsdl:portType[@name='IVideoSearchService']
    
    Custom tool warning: Cannot import wsdl:binding
    Detail: There was an error importing a wsdl:portType that the wsdl:binding is dependent on.
    XPath to wsdl:portType: //wsdl:definitions[@targetNamespace='http://fliqz.com/services/search/20071001']/wsdl:portType[@name='IVideoSearchService']
    XPath to Error Source: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:binding[@name='basicHttpBinding_IVideoSearchService_20071001']
    
    Custom tool warning: Cannot import wsdl:port
    Detail: There was an error importing a wsdl:binding that the wsdl:port is dependent on.
    XPath to wsdl:binding: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:binding[@name='basicHttpBinding_IVideoSearchService_20071001']
    XPath to Error Source: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:service[@name='VideoSearchService']/wsdl:port[@name='basicHttpBinding_IVideoSearchService_20071001']
    
    Custom tool error: Failed to generate code for the service reference 'ServiceReference1'.  Please check other error and warning messages for details.
    

    编辑: 我做了一些挖掘,发现了以下链接:

    原因

    如果您可以获得ServiceContract接口及其公开的类型,那么您可能可以手动生成自己的客户机。从我在那里看到的一些类名来看,Fliqz似乎在其契约中公开了内部对象,所以我怀疑您是否可以,您知道,给他们打电话,要求他们提供一个可以引用的.dll。

    对不起,我帮不了你了。这似乎是Fliqz方面糟糕的WCF遗留支持和糟糕的架构/设计的结合。

        3
  •  2
  •   Alan    16 年前

    尝试将其添加为.NET 2.0 Web引用。

    转到添加服务引用,然后单击“高级”按钮。然后,您可以选择将其添加为.NET2.0Web引用。我这样做了,并让它发挥作用。我无法通过标准的“添加服务引用”

        4
  •  1
  •   Randolpho    16 年前

    我没有看到任何<wsdl:portType>WSDL中的元素—这可能就是问题所在。

    <wsdl:import namespace="http://fliqz.com/services/search/20071001" location="http://services.fliqz.com/LegacyServices/Services/search/R20071001/service.svc?wsdl=wsdl0"/>

    马克