如何从 wsdl 创建代理类
本文关键字:代理 创建 wsdl | 更新日期: 2023-09-27 18:28:53
C: ' Program Files ' Microsoft Visual Studio 10.0 ' VC> svcutil wsdl.wsdl / out: Proxy.
Microsoft (R) Service Model Metadata Tool
[Microsoft (R) Windows (R) Communication Foundation, Version 3.0.4506.2152]
Copyright (c) Microsoft Corporation. All rights reserved.
Error: Can not import wsdl: portType
Details: Generated an exception at run time extension of import WSDL:
System.ServiceModel.Description.DataContractSerializerMessageContractImporter
Error: element complexType "http://api-new.begun.ru/index.php:Region" is already a Listing
flax.
XPath to Error Source: / / wsdl: definitions [@ targetNamespace = 'http://api-new.be
gun.ru / index.php '] / wsdl: portType [@ name =' AdvertiserServicePortType ']
Error: Can not import wsdl: binding
Details: Failed to import wsdl: portType, on which the wsdl: binding.
XPath to wsdl: portType: / / wsdl: definitions [@ targetNamespace = 'http://api-new.begun
.ru / index.php '] / wsdl: portType [@ name =' AdvertiserServicePortType ']
XPath to Error Source: / / wsdl: definitions [@ targetNamespace = 'http://api-new.be
gun.ru / index.php '] / wsdl: binding [@ name =' AdvertiserServiceBinding ']
Error: Can not import wsdl: port
Details: Failed to import wsdl: binding, which depends on the wsdl: port.
XPath to wsdl: binding: / / wsdl: definitions [@ targetNamespace = 'http://api-new.begun.
ru / index.php '] / wsdl: binding [@ name =' AdvertiserServiceBinding ']
XPath to Error Source: / / wsdl: definitions [@ targetNamespace = 'http://api-new.be
gun.ru / index.php '] / wsdl: service [@ name =' AdvertiserService '] / wsdl: port [@ name =' Adve
rtiserServicePort ']
Generating files ...
Warning: No code was generated.
If you were trying to generate a client, this could be because the metadata docu
ments did not contain any valid contracts or services
or because all contracts / services were discovered to exist in / reference assembl
ies. Verify that you passed all the metadata documents to the tool.
Warning: If you would like to generate data contracts from schemas make sure to
use the / dataContractOnly option.
如何解决?我需要 C# 中的代理类
更新:
http://www.2shared.com/file/JAoRmgXI/wsdl.html
我想 wsdl 引用了一些不在同一目录中的其他文件(.xsd ?(。
更新:关于区域的第一个错误是存在的,因为区域被定义了两次(第 253 行和第 274 行(。
更新 2:RegionArray 也被声明了两次。客户端代理生成的工作原理是删除两个 twice 声明并使用 wsdl.exe: wsdl.exe wsdl.wsdl /out:Proxy.cs
。