“添加服务引用..."到 xsd [英] "Add Service Reference..." to xsd

查看:34
本文介绍了“添加服务引用..."到 xsd的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以在 Visual Studio 2010 中创建对 xsd 的服务引用.该参考下载所有链接的 xsd 文件.但是,我有两个问题,我想看看是否有解决方案:

  • 每个 xsd 的 URL 实际上以 .gx 结尾(例如,http://mycompany.com/Schema1.gx).当 Visual Studio 导入文件时,它会将它们重命名为 .xsd,但在 xsd:import 节点中,它将原始引用名称保留为 .gx,因此我的引用一旦在 Visual Studio 中就未找到或无效"

  • 对于某些 xsd:import 语句,引用的 .gx 文件的路径在另一个目录中(例如,schemaLocation="subDirectory1/Schema1.gx").但是,当它们被导入时,所有 xsd 文件都在 Visual Studio 中的同一目录中,但同样,xsd:import 节点没有被修改以反映更扁平的结构.

是否有以有效方式导入这些 xsd 的解决方案?

解决方案

这很可能是一个错误 - svcutil 没有重构"架构.如果您想要一个处理此类工作的工具并且更喜欢它,this XML Schema 重构工具应该会有所帮助.下载、安装并创建一个新的 XML 架构重构文件 (.xsr);添加一个新的 XML 模式集合;右键单击1.0版本,选择[Import Schema Files...]命令并按照提示操作.它可以吞食"在线模式,包括从 WSDL 文件中引用或嵌入到 WSDL 文件等中的模式.

I can create a service reference in Visual Studio 2010 to an xsd. That reference downloads all the linked xsd files. However, I have 2 problems I'd like to see if there are solutions:

  • The URL for each xsd actually ends in .gx (e.g., http://mycompany.com/Schema1.gx). When Visual Studio imports the files, it renames them to .xsd, but in the xsd:import node, it keeps the original reference name with .gx, so my reference, once it's in Visual Studio is "not found or invalid"

  • for some of the xsd:import statements, the path to the referred-to .gx file is in another directory (e.g., schemaLocation="subDirectory1/Schema1.gx"). However, when they're imported, all xsd files are in the same directory in Visual Studio, but again, the xsd:import node is not modified to reflect the flatter structure.

Is there a solution to import these xsds in a valid way?

解决方案

It is most likely a bug - the svcutil doesn't "refactor" the schemas. If you want a tool that handles this kind of work and more like it, this XML Schema refactoring tool should help. Download, install and create a new XML Schema Refactoring file (.xsr); add a new XML Schema collection; right click on the version 1.0, select [Import Schema Files...] command and follow the prompts. It can "slurp" online schemas, including ones referenced from, or embedded into, WSDL files, etc.

这篇关于“添加服务引用..."到 xsd的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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