在 WSDL 中包含 XSD

2024-05-13

我正在编写一个 wsdl 文件来在未来(SoapUI)中部署模拟服务,但我在包含我的 xsd 文件时遇到问题。

XSD File

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning" elementFormDefault="qualified" attributeFormDefault="unqualified" vc:minVersion="1.1">
    <!--Déclaration des types complexes -->
    <xs:complexType name="TSujet">
        <xs:sequence>
            <xs:element name="identifiant" type="xs:string"/>
            <xs:element name="libelleCourt" type="xs:string"/>
            <xs:element name="libelleLong" type="xs:string"/>
            <xs:element name="incidents">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element name="incident" type="TRefIncident" minOccurs="0" maxOccurs="unbounded"/>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
        </xs:sequence>
    </xs:complexType>
    <xs:complexType name="TRefIncident">
        <xs:sequence>
            <xs:element name="identifiant" type="xs:string"/>
            <xs:element name="libelle" type="xs:string"/>
            <xs:element name="erreursConnues">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element name="erreurConnue" type="TErreurConnue" minOccurs="0" maxOccurs="unbounded"/>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
        </xs:sequence>
    </xs:complexType>
    <xs:complexType name="TErreurConnue">
        <xs:sequence>
            <xs:element name="identifiant" type="xs:string"/>
            <xs:element name="texte" type="xs:string"/>
            <xs:element name="documents">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element name="document" type="TDocument" minOccurs="0" maxOccurs="unbounded"/>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
        </xs:sequence>
    </xs:complexType>
    <xs:complexType name="TDocument">
        <xs:sequence>
            <xs:element name="identifiant" type="xs:string"/>
            <xs:element name="type" type="xs:string"/>
            <xs:element name="contenu" type="xs:string"/>
        </xs:sequence>
    </xs:complexType>
    <xs:complexType name="TUtilisateur">
        <xs:sequence>
            <xs:element name="login" type="xs:string"/>
            <xs:element name="nom" type="xs:string"/>
            <xs:element name="prenom" type="xs:string"/>
            <xs:element name="codePoste" type="xs:string"/>
            <xs:element name="telephone" type="xs:string"/>
        </xs:sequence>
    </xs:complexType>
    <!-- Déclaration des éléments -->
    <xs:complexType name="TTheme">
        <xs:sequence>
            <xs:element name="identifiant" type="xs:string"/>
            <xs:element name="libelleCourt" type="xs:string"/>
            <xs:element name="libelleLong" type="xs:string"/>
            <xs:element name="top" type="xs:string" minOccurs="0" maxOccurs="5"/>
            <xs:element name="sujets">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element name="sujet" type="TSujet" minOccurs="0" maxOccurs="unbounded"/>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
        </xs:sequence>
    </xs:complexType>
    <xs:complexType name="TTicket">
        <xs:sequence>
            <xs:element name="identifiant" type="xs:string"/>
            <xs:element name="libelle" type="xs:string"/>
            <xs:element name="date" type="xs:string"/>
            <xs:element name="document" type="xs:string"/>
            <xs:element name="objet" type="xs:string"/>
            <xs:element name="description" type="xs:string"/>
            <xs:element name="destinataire" type="xs:string"/>
            <xs:element name="statut" type="xs:string"/>
            <xs:element name="commentaire" type="xs:string"/>
            <xs:element name="refIncident" type="TRefIncident"/>
            <xs:element name="utilisateur" type="TUtilisateur"/>
        </xs:sequence>
    </xs:complexType>
    <xs:complexType name="TNews">
        <xs:sequence>
            <xs:element name="identifiant" type="xs:string"/>
            <xs:element name="libelle" type="xs:string"/>
            <xs:element name="description" type="xs:string"/>
        </xs:sequence>
    </xs:complexType>
    <xs:complexType name="TIncidentDeMasse">
        <xs:sequence>
            <xs:element name="identifiant" type="xs:string"/>
            <xs:element name="libelle" type="xs:string"/>
            <xs:element name="description" type="xs:string"/>
        </xs:sequence>
    </xs:complexType>
</xs:schema>

WSDL文件

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.example.org/passerelle/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="passerelle" targetNamespace="http://www.example.org/passerelle/">

  <wsdl:types>
    <xsd:schema targetNamespace="http://www.example.org/passerelle/">
      <include schemaLocation="schema.xsd"/>
    </xsd:schema>
  </wsdl:types>

  <wsdl:message name="getAllCatalogueResponse">
    <wsdl:part name="catalogue" type="tns:TTheme"/>
  </wsdl:message>
  <wsdl:message name="createTicketRequest">
    <wsdl:part name="data" type="tns:TTicket"></wsdl:part>
  </wsdl:message>
  <wsdl:message name="createTicketResponse">
    <wsdl:part name="return" type="xsd:string"></wsdl:part>
  </wsdl:message>
  <wsdl:message name="getTicketsRequest">
    <wsdl:part name="idUser" type="xsd:string"></wsdl:part>
  </wsdl:message>
  <wsdl:message name="getTicketsResponse">
    <wsdl:part name="tickets" type="tns:TTicket"></wsdl:part>
  </wsdl:message>
  <wsdl:message name="getMessagesResponse">
    <wsdl:part name="incidents" type="tns:TIncidentDeMasse"></wsdl:part>
    <wsdl:part name="news" type="tns:TNews"></wsdl:part>
  </wsdl:message>

  <wsdl:portType name="passerelle">
    <wsdl:operation name="getAllCatalogue">
      <wsdl:output message="tns:getAllCatalogueResponse"/>
    </wsdl:operation>
    <wsdl:operation name="createTicket">
        <wsdl:input message="tns:createTicketRequest"></wsdl:input>
        <wsdl:output message="tns:createTicketResponse"></wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="getTickets">
        <wsdl:input message="tns:getTicketsRequest"></wsdl:input>
        <wsdl:output message="tns:getTicketsResponse"></wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="getMessages">
        <wsdl:output message="tns:getMessagesResponse"></wsdl:output>
    </wsdl:operation>
  </wsdl:portType>

  <wsdl:binding name="passerelleSOAP" type="tns:passerelle">
    <soap:binding style="document"
        transport="http://schemas.xmlsoap.org/soap/http" />
    <wsdl:operation name="getAllCatalogue">
        <soap:operation
            soapAction="http://www.example.org/passerelle/getAllCatalogue" />
        <wsdl:input>
            <soap:body use="literal" />
        </wsdl:input>
        <wsdl:output>
            <soap:body use="literal" />
        </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="createTicket">
        <soap:operation
            soapAction="http://www.example.org/passerelle/createTicket" />
        <wsdl:input>
            <soap:body use="literal" />
        </wsdl:input>
        <wsdl:output>
            <soap:body use="literal" />
        </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="getTickets">
        <soap:operation
            soapAction="http://www.example.org/passerelle/getTickets" />
        <wsdl:input>
            <soap:body use="literal" />
        </wsdl:input>
        <wsdl:output>
            <soap:body use="literal" />
        </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="getMessages">
        <soap:operation
            soapAction="http://www.example.org/passerelle/getMessages" />
        <wsdl:output>
            <soap:body use="literal" />
        </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>

  <wsdl:service name="passerelle">
    <wsdl:port binding="tns:passerelleSOAP" name="passerelleSOAP">
      <soap:address location="http://www.example.org/"/>
    </wsdl:port>
  </wsdl:service>

</wsdl:definitions>

你有什么建议吗?如何知道文件是否包含在内?我使用 Eclipse 来编辑它们。


使用<xs:import>在你的 wsdl 中标记

<wsdl:types>
    <xsd:schema>
        <xs:import namespace="http://www.example.org/passerelle" schemaLocation="schema.xsd"/>
    </xsd:schema>
</wsdl:types>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

在 WSDL 中包含 XSD 的相关文章

随机推荐

  • 如何在 astro 中将服务器变量传递给客户端 JS?

    I found this https developers google com calendar api quickstart js step 1 set up the sample github https github com goo
  • WPF TabControl的SelectedIndex设置问题

    我有一个包含两个项目的 TabControl
  • 确定一个范围是否完全被一组范​​围覆盖

    如何检查范围是否为完全覆盖由一组范围 在以下示例中 WITH ranges id a b AS SELECT 1 0 40 UNION SELECT 2 40 60 UNION SELECT 3 80 100 UNION SELECT 4
  • MySQL - 替换列中的字符

    作为一个自学成才的新手 我给自己制造了一个大问题 在将数据插入数据库之前 我将字符串中的撇号 转换为双引号 而不是 MySQL 实际需要的反斜杠和撇号 在我的表增长到超过 200 000 行之前 我认为最好立即纠正此问题 所以我做了一些研究
  • 相当于 java PBKDF2WithHmacSHA1 的 Python

    我的任务是构建一个 API 的使用者 该 API 需要带有 UNIX 时间种子值的加密令牌 我看到的示例是使用我不熟悉的 Java 实现的 在阅读文档和其他堆栈文章后一直无法找到解决方案 使用javax crypto SecretKey j
  • FlatList 和 VirtualizedList 的区别

    我是 React Native 的新手 对两者之间的区别感到困惑FlatList and VirtualizedList So 两者有什么区别FlatList and VirtualizedList 我应该什么时候使用每个 The
  • htaccess隐藏php扩展时出错,只隐藏html

    我在使用 htaccess 隐藏网站上的 php 扩展时遇到问题 我看到很多网站试图修复它 但没有任何结果 但只有 html 扩展名对我来说是隐藏的 在我的 htaccess 上 我用这个来隐藏扩展 它就在错误页面之后 这是我的 htacc
  • 致命错误:调用未定义的方法 mysqli_stmt::query()

    为什么我会收到以下错误 致命错误 调用未定义的方法 mysqli stmt query mysqli new mysqli localhost or die mysqli gt connect error function checklog
  • Python 3 中的递归搜索 JSON/DICT

    我在 Python 3 中实现了一些 API 这些 API 允许我根据班级代码接收有关学校的信息 但我想知道如何通过类代码获取信息 例子 我输入代码GF528S我希望程序告诉我班级 3C INF 地址 Address 1 Milan 如果可
  • 使用本地 JSON 数据填充 jQuery Mobile ListView

    我正在尝试使用本地 JSON 信息填充 JQM ListView 但是 不会创建任何列表项 任何帮助 将不胜感激 这是我的代码 JSON 文件结构 name test calories 1000 fat 100 protein 100 ca
  • 是否可以“缩小”PdfPtable?

    我目前正在使用 Itextsharp 但在使用 PDfPtables 时遇到一些问题 有时 它们对于一个页面来说太大了 并且当添加到文档中时 它们会被分成多个页面 可悲的是 这种理性的行为对于我的一些上级来说是不可接受的 他们一直坚持认为表
  • 使用 Python 或 Django 处理收到的电子邮件?

    我了解如何通过 Django 发送电子邮件 但我希望用户能够回复电子邮件 如果他们发送 以及我收到 的电子邮件包含与某个字符串匹配的消息 我将调用一个函数 我已经做了一些谷歌搜索 但除了自己制作脚本之外似乎没有什么好的解决方案 如果有什么东
  • 创建通用数组时出错

    public class TwoBridge implements Piece private HashSet
  • 将 vim 的 vertsplit 字符更改为 │

    我认为这与代码页相关 但询问也无妨 在 windows xp 的 cmd 上 gvim 7 2 如何更改 vertsplit 字符 而不是默认的 它是 因此它是一条完整的线 而不是一条分割线 该字符通常会更改为 set fillchars
  • WCF 是否始终需要我的主机具有管理员权限?

    我正在跟进this http msdn microsoft com en us library ms730935 aspx教程 似乎要在我的应用程序中实现 WCF 它需要以管理员权限运行 我想使用远程处理only同一台机器上的进程之间进行通
  • 如何将值从 android 传递到 php Web 服务并检索它?

    我正在尝试将一个值传递给我的 php web 服务 我已经使用此代码来传递 名称 值 private class MyAsyncTask extends AsyncTask
  • 具有用于角色授权的空间的 AD 组

    我正在尝试获得与 AD 组合作的角色授权 然而 由于它包含空格 它似乎不起作用 我尝试过没有空格的 AD 组 它们工作得很好
  • libicui18n.so.52:无法打开共享对象文件

    我一直在使用 libicu 来检测在 docker ubuntu 内部运行的节点应用程序中的字符集 这是通过模块完成的节点 icu 字符集检测器 https github com mooz node icu charset detector
  • SQL where 连接集必须包含所有值,但可以包含更多值

    我有三张桌子offers sports和连接表offers sports class Offer lt ActiveRecord Base has and belongs to many sports end class Sport lt
  • 在 WSDL 中包含 XSD

    我正在编写一个 wsdl 文件来在未来 SoapUI 中部署模拟服务 但我在包含我的 xsd 文件时遇到问题 XSD File