【问题标题】:How do i convert this simple type xsd to a complex type XSD如何将此简单类型 xsd 转换为复杂类型 XSD
【发布时间】:2013-10-23 18:37:14
【问题描述】:

`我有一个简单类型的 xsd 元素,我想将其转换为复杂类型,因为我希望最终的 wsdl 是文档类型文字格式。你们能帮忙吗?

<xsd:element name="Service">
    <xsd:simpleType>
      <xsd:restriction base="xsd:string">
        <xsd:enumeration value="loan.CreateLead" />
      </xsd:restriction>
    </xsd:simpleType>
  </xsd:element>

我希望将其转换为具有相同名称元素并具有枚举值的复杂类型。请让我知道这件事? 谢谢 补眼

【问题讨论】:

    标签: xsd wsdl


    【解决方案1】:

    这是一种方法。问题是,您一次只能扩展/限制一个,因此采用两步法。

    我保持原来的不变仅供参考,否则第一个服务元素可能是“限制”类型。

    <?xml version="1.0" encoding="utf-8" ?>
    <!-- XML Schema generated by QTAssistant/XSD Module (http://www.paschidev.com) -->
    <xsd:schema targetNamespace="http://tempuri.org/XMLSchema.xsd" xmlns="http://tempuri.org/XMLSchema.xsd" elementFormDefault="qualified" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
        <xsd:element name="Service">
            <xsd:simpleType>
                <xsd:restriction base="xsd:string">
                    <xsd:enumeration value="loan.CreateLead"/>
                </xsd:restriction>
            </xsd:simpleType>
        </xsd:element>
    
        <xsd:simpleType name="arestriction">
            <xsd:restriction base="xsd:string">
                <xsd:enumeration value="loan.CreateLead"/>
            </xsd:restriction>
        </xsd:simpleType>
    
        <xsd:element name="Service1">
            <xsd:complexType>
                <xsd:simpleContent>
                    <xsd:extension base="arestriction"/>
                </xsd:simpleContent>
            </xsd:complexType>
        </xsd:element>
    </xsd:schema>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-07-11
      • 1970-01-01
      • 2017-08-21
      相关资源
      最近更新 更多