XML模式和WSDL之间的区别是什么?
我注意到的区别是WSDL包含XSD,我们可以在WSDL中声明操作,但不能在XSD中声明。对吗?
XML模式和WSDL之间的区别是什么?
我注意到的区别是WSDL包含XSD,我们可以在WSDL中声明操作,但不能在XSD中声明。对吗?
XSD定义了一个模式,它定义了XML文档的结构。您可以使用它来检查给定的XML文档是否有效,是否符合您在模式中设置的规则。
WSDL是描述web服务的XML文档。它显示了哪些操作是可用的,以及应该如何结构化数据以发送给这些操作。
WSDL文档有一个相关联的XSD,它显示在WSDL文档中放入什么是有效的。
XSD (XML模式定义)定义XML文档中的元素。它可用于验证xml文档中的元素是否符合将放置内容的描述。 而wsdl是描述web服务的特定类型的XML文档。WSDL本身依附于XSD。
WSDL (Web服务描述语言)描述了你的服务和它的操作——服务被调用了什么,它提供了哪些方法,这些方法有什么样的参数和返回值?
它是对服务行为的描述——它是功能。
XSD (Xml模式定义)描述了由这些服务方法交换的复杂数据类型的静态结构。它描述了类型、它们的字段、对这些字段的任何限制(比如最大长度或正则表达式模式)等等。
它是数据类型的描述,因此是服务的静态属性——它是关于数据的。
WSDL -它包含web服务提供的操作,如方法。这些方法可以接受简单的数据类型,如int、float等,也可以接受复杂的数据类型,如对象、向量、数组等,因此可以使用XSD将其映射到XML数据类型。基于XSD,用户可以从不同的平台访问web服务,并提供相应的数据。
参考:ayazroomy-java.blogspot.com来阅读关于webservice的基础知识。
XML模式定义。
可扩展标记语言。
WSDL: Web服务定义语言。
我不会用专业术语来回答。我的解释是针对初学者的。
It is not easy to communicate between two different applications that are developed using two different technologies. For example, a company in Chicago might develop a web application using Java and another company in New York might develop an application in C# and when these two companies decided to share information then XML comes into picture. It helps to store and transport data between two different applications that are developed using different technologies. Note: It is not limited to a programming language, please do research on the information transportation between two different apps.
XSD is a schema definition. By that what I mean is, it is telling users to develop their XML in such a schema. Please see below images, and please watch closely with "load-on-startup" element and its type which is integer. In the XSD image you can see it is meant to be integer value for the "load-on-startup" and hence when user created his/her XML they passed an int value to that particular element. As a reminder, XSD is a schema and style whereas XML is a form to communicate with another application or system. One has to see XSD and create XML in such a way or else it won't communicate with another application or system which has been developed with a different technology. A company in Chicago provides a XSD template for a company in Texas to write or generate their XML in the given XSD format. If the company in Texas failed to adhere with those rules or schema mentioned in XSD then it is impossible to expect correct information from the company in Chicago. There is so much to do after the above said story, which an amateur or newbie have to know while coding for some thing like I said above. If you really want to know what happens later then it is better to sit with senior software engineers who actually developed web services. Next comes WSDL, please follow the images and try to figure out where the WSDL will fit in.
***************======== 下面是部分XML的形象 ==========***************
***************======== 下面是部分XSD的形象 ==========***************
***************======== 下面是部分WSDL的形象 =======*************
I had to create a sample WSDL for a web service called Book. Note, it is an XSD but you have to call it WSDL (Web Service Definition Language) because it is very specific for Web Services. The above WSDL (or in other words XSD) is created for a class called Book.java and it has created a SOAP service. How the SOAP web service created it is a different topic. One has to write a Java class and before executing it create as a web service the user has to make sure Axis2 API is installed and Tomcat to host web service is in place.
As a servicer (the one who allows others (clients) to access information or data from their systems ) actually gives the client (the one who needs to use servicer information or data) complete access to data through a Web Service, because no company on the earth willing to expose their Database for outsiders. Like my company, decided to give some information about products via Web Services, hence we had to create XSD template and pass-on to few of our clients who wants to work with us. They have to write some code to make complete use of the given XSD and make Web Service calls to fetch data from servicer and convert data returned into their suitable requirement and then display or publish data or information about the product on their website. A simple example would be FLIGHT Ticket booking. An airline will let third parties to use flight data on their site for ticket sales. But again there is much more to it, it is just not letting third party flight ticket agent to sell tickets, there will be synchronize and security in place. If there is no sync then there is 100 % chances more than 1 customer might buy same flight ticket from various sources.
我希望专家们能给出答案。对于新手或新手来说,理解XML、XSD然后在Web服务上工作是非常困难的。
如果有人正在寻找类比,这个答案可能会有帮助。
WSDL就像mysql中的'SHOW TABLE STATUS'命令。它定义了所有应该成为XML一部分的元素(请求类型、响应类型、命中请求的URL格式等)。我的意思是: 1)请求或响应的名称 2)什么应该被视为输入,什么应该被视为输出。
XSD类似于mysql中的DESCRIBE命令。它告诉所有的变量和它们的类型,一个请求和响应包含什么。
XSD是WSDL文件的模式。XSD包含WSDL的数据类型。在XSD中声明的元素可以在WSDL文件中使用。 我们可以对照XSD检查WSDL以检查web服务WSDL是否有效。