针对服务 WSDL 运行 SvcUtil.exe 时出错 [英] Error when Running SvcUtil.exe Against Service WSDL

查看:27
本文介绍了针对服务 WSDL 运行 SvcUtil.exe 时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为另一个实体公开的 SOAP 服务创建服务代理.运行后:

I am trying to create a service proxy for a SOAP service exposed by another entity. After running:

svcutil.exe https://<domain-omitted>/feed30/clientdataservice.asmx?wsdl

我收到以下错误:

Attempting to download metadata from 'https://<domain-
omitted>/feed30/clientdataservice.asmx' using WS-Metadata Exchange or DISCO
Generating files...
Warning: No code was generated.
If you were trying to generate a client, this could be because the metadata documents did not contain any valid contracts or services or because all contracts/services were discovered to exist in /reference assemblies. 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.

我过去曾看到这可能与实用程序无法访问 WSDL 中的所有 xmlns 路径有关.那些是:

I've seen in the past that this might be related to the utilities inability to access all of the xmlns paths in the WSDL. Those are:

xmlns:s="http://www.w3.org/2001/XMLSchema" 
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" 
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" 
xmlns:s2="http://microsoft.com/wsdl/types/" 
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"

WSDL 的导入语句中包含的唯一一个是 xmlns:s2="http://microsoft.com/wsdl/types/"

The only one included in an import statement in the WSDL is xmlns:s2="http://microsoft.com/wsdl/types/"

我找不到我曾经看到的信息,其中您可以手动下载每个架构文档并将其作为参数提供给 svcutil 实用程序.我是在正确的轨道上,还是应该寻找其他地方?

I can't find information that I once saw wherein you could manually download each schema document and provide it as a parameter to the svcutil utility. Am I on the right track, or should I be looking somewhere else?

感谢任何帮助.

推荐答案

根据 MarvinSmit 的评论,我手动将 WSDL 数据下载到本地文件中.我通过 Bing 找到了对http://microsoft.com/wsdl/types/"的引用在这里,'http://msdn.microsoft.com/en-us/library/jj675594(v=office.12).aspx'.我将它下载到它自己的 .xsd 文件中.然后我将本地 WSDL 中的导入引用替换为本地 XSD 文件的导入引用.Ran svcutil 指向我本地的 WSDL 文件,poof,它生成了一个有效的代理.

Per MarvinSmit's comment, I manually downloaded the WSDL data into a local file. I found a reference to the 'http://microsoft.com/wsdl/types/' through Bing here, 'http://msdn.microsoft.com/en-us/library/jj675594(v=office.12).aspx'. I downloaded that into it's own .xsd file. I then replaced the import reference in the local WSDL to be that of the local XSD file. Ran svcutil pointed at my local WSDL file and poof, it generated a proxy that worked.

这篇关于针对服务 WSDL 运行 SvcUtil.exe 时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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