我是否必须在 svcutil.exe 命令中包含 xml 命名空间?
我需要创建一个代理类,以便我可以与 Java Web 服务(我无法控制)进行通信。
Web 服务应该实现catalog (CSW) OGC 标准。但是,wsdl 中没有包含或导入,只是在 wsdl 顶部引用命名空间,如下所示:
<?xml version="1.0" encoding="UTF-8"?>
<wsd:definitions xmlns:wsd="http://schemas.xmlsoap.org/wsdl" xmlns:csw="http://www.opengis.net/cat/csw/2.0.2" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime" xmlns:ows="http://www.opengis.net/ows" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap" xmlns:tns="http://www.mda.ca/hma/wsdl1.1" xmlns:wrs="http://www.opengis.net/cat/wrs/1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" ...
所以我的两部分问题是:
- 这些 xmlns 标记是否足以让我从中创建代理? (我认为不是,因为我认为它们只是“提示”,甚至不是任何 xsd 文件的正确或有效位置)
- 如果是这样,我应该将它们包含在我的 svcutil 命令中,如下所示:
svcutil http://wsdllocation.com/thewsdl.wsdl http://www.opengis.net/cat/csw/2.0.2 ...
我的问题是我无法从此 wsdl 创建代理类。我尝试将“每个人”添加到我的“c:/windows/temp/”目录并具有修改权限。我尝试直接使用 svcutil 调用 wsdl 。我尝试下载 wsdl 以及整个 OGC 模式文件,并将它们全部包含在我的 svcutil 命令中,但仍然出现以下错误:
正在生成文件... 警告:未生成任何代码。 如果您尝试生成客户端,这可能是因为
元数据文档不包含任何 有效公司 塞斯 或者因为所有合同/服务都被发现存在于 /reference 中 组件。验证您是否全部通过 th 进入该工具。
警告:如果您想从模式生成数据契约
确保使用 /dataContractOnly 选项。
I need to create a proxy class so i can communicate with a Java web service (which i have no control over).
The web service is supposed to be implemeting the catalog (CSW) OGC standard. However There are NO includes or imports in the wsdl just namespace referencing at the top of the wsdl like this:
<?xml version="1.0" encoding="UTF-8"?>
<wsd:definitions xmlns:wsd="http://schemas.xmlsoap.org/wsdl" xmlns:csw="http://www.opengis.net/cat/csw/2.0.2" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime" xmlns:ows="http://www.opengis.net/ows" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap" xmlns:tns="http://www.mda.ca/hma/wsdl1.1" xmlns:wrs="http://www.opengis.net/cat/wrs/1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" ...
So my TWO part question is:
- Are these xmlns tags enough for me to create a proxy from? ( i would think not because i think they are just "hints" and not even the correct or valid location of any xsd files )
- If so, should i be including them in my svcutil command like such:
svcutil
http://wsdllocation.com/thewsdl.wsdl
http://www.opengis.net/cat/csw/2.0.2
...
My problem is that i can't create a proxy class from this wsdl. I've tried adding "everyone" to my "c:/windows/temp/" directory with modify rights. I've tried calling the wsdl with svcutil directly. I've tried donwloading the wsdl along with the entire OGC schema files and including them all withing my svcutil command but still get the following error:
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 co
ces
or because all contracts/services were discovered to exist in /reference
assemblies. Verify that you passed all
th
ents to the tool.Warning: If you would like to generate data contracts from schemas
make sure to use the /dataContractOnly
option.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不,您将需要实际的模式,并且实际上需要从 WSDL 的
部分引用它们。您可以发布 WSDL 的 URL 吗?我想看看是否有效。
No, you will need the actual schemas, and they will actually need to be referenced from the
<types>
section of the WSDL.Can you post the URL of the WSDL? I'd like to see if it's valid.