如何从 xsd 创建 wsdl [英] How to create wsdl from xsd

查看:37
本文介绍了如何从 xsd 创建 wsdl的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用 3 个 xsd 文件创建一个 wsdl.你怎么看?

我在命令提示符下试过这个:

wsdl.exe/language:cs/parameters: c:\myService\Contract\HeaderData.xsd c:\myService\Contract\MyData.xsd c:\myService\Contract\Messages.xsd/out: MyWsdl.wsdl

我做错了什么?

解决方案

我相信这里有一个误解.您插图中的 wsdl.exe 很可能指的是 有某种方法可以定义请求/响应元素),因此基于这些假设,诸如 QTAssistant(我与它相关联)之类的专用工具将少问你问题,同时仍然创建 WSDL.

我记得有一两个在线工具可以让用户上传 XSD 文件,然后在提示您几个问题后创建 WSDL,但我似乎再也找不到它们了......有点喜欢这个...

I want to create a wsdl by using 3 xsd-files. How do you that?

I tried this in the command prompt:

wsdl.exe /language:cs /parameters: c:\myService\Contract\HeaderData.xsd c:\myService\Contract\MyData.xsd c:\myService\Contract\Messages.xsd /out: MyWsdl.wsdl

What do I wrong?

解决方案

I believe that there's a misunderstanding here. Most likely the wsdl.exe in your illustration refers to Microsoft's tool, which is described as:

The Web Services Description Language tool generates code for XML Web services and XML Web service clients from WSDL contract files, XSD schemas, and .discomap discovery documents.

From what you seem to imply by asking the output to be a WSDL file, I can safely assume that you really try to create a WSDL file starting from XSD files. Below I am trying to explain why you cannot do that that easy, and what options you have.

The diagram below shows you the model behind the WSDL 1.1 specification.

Your XSDs fit exactly, and only under types. It WSDL terms, types represent your type system used to describe the parts that make up messages, which are then used to describe input/output and faults of operations organized as ports (abstract interfaces) bound to application/transport protocols, and ultimately made (physically) accessible as services at one or more network endpoints.

To generate WSDL(s) out of XSD(s), you realized by now that you need to provide some more data to a tool that would automatically generate a WSDL for you. For example, what operations you want to describe in your WSDL? For each one of them, what's the input, most likely the output and maybe one or more faults? How would you group them (portType = interface)? What binding do you want to use: HTTP, SOAP? What version of SOAP? SOAP over: HTTP, MQ? SOAPAction? How many WSDL files: 1, or maybe 3?

Some tools may ask you a series of questions (data entry/wizards) along the above lines and then create the WSDL(s) for you. Others, use predefined patterns in the implementation of XSD schema constructs (for example, IFX has a certain way to define Request/Response elements) so based on those assumptions a specialized tool such as QTAssistant (I am associated with it) would ask you less questions, while still creating the WSDLs.

I remember one or two online tools that were able to allow the user to upload XSD files and then create WSDL after prompting you a couple of questions, but I can't seem to find them anymore... kind of like this one...

这篇关于如何从 xsd 创建 wsdl的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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