是否创建在生成的请求中显示的注释?WSDL-SOAP-xml

是否创建在生成的请求中显示的注释?WSDL-SOAP-xml,soap,wsdl,soapui,Soap,Wsdl,Soapui,Im正在为现有系统编写wsdl文件。我想向生成的请求添加注释 例如: <xsd:simpleType name="coffeetype"> <xsd:restriction base="xsd:integer"> <!--0=likescoffee,1=doesnotlikecoffe--> <xsd:enumeration value="0" /> &

Im正在为现有系统编写
wsdl
文件。我想向生成的请求添加注释

例如:

    <xsd:simpleType name="coffeetype">
        <xsd:restriction base="xsd:integer">
            <!--0=likescoffee,1=doesnotlikecoffe-->
            <xsd:enumeration value="0" />
            <xsd:enumeration value="1" />
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:element name="CoffeeRequestInput" nillable="false" type="tns:coffeetype" />

在生成的请求中应该是这样的:(例如,在SoapUI中加载WSDL时)


0
我在打开
WSDL
时能够看到这些注释,但在从该
WSDL
生成请求时却看不到这些注释


我已经研究了注释,但是我无法使用它们来创建我想要的结果。(可能是我的一个错误)

简而言之,您不能按照自己的意愿在请求中创建文档。但是,您可以从WSDL生成非常有用的文档。通过使用“xsd:documentation”标记,可以将文档直接添加到元素中

比如说

<xsd:simpleType name="coffeetype">
    <xsd:restriction base="xsd:integer">

        <xsd:enumeration value="0" />
        <xsd:enumeration value="1" />
    </xsd:restriction>
</xsd:simpleType>
<xsd:element name="CoffeeRequestInput" nillable="false" type="tns:coffeetype">
    <xsd:annotation>
        <xsd:documentation>
          This object is the CoffeeRequestInput object is an Enumeration which can be used to determine is the user sending the request likes coffee or not. 
           Valid values for the enumeration is as follows:
           0 = like coffee
           1 = does not like coffee (probably a user not a programmer making a request).
           Some other things that you need to document goes here.
        </xsd:documentation>   
    </xsd:annotation>
</xsd:element>

此对象是CoffeeRequestInput对象是一个枚举,可用于确定发送请求的用户是否喜欢咖啡。
枚举的有效值如下所示:
你喜欢咖啡吗
1=不喜欢咖啡(可能是用户而不是程序员提出请求)。
这里还有一些你需要记录的东西。
然后,您可以使用Altova StyleForce、LiquidXML和OxyGen等软件生成PDF、Word文档或HTML页面,这些页面显示SOAP服务和操作以及您的所有评论


如果您觉得可以,您可以编写自己的XLST,将WSDL和XSD转换为一个整洁的HTML页面,该页面还记录了您的接口。最好的一点是,当您使用新操作等更新WSDL时,文档也会更新。

您可以使用xsd:documentation标记将文档添加到xsd中。请参阅此链接。这是记录您的请求、回复和结构的标准方式。但它不会出现在请求中。@Namphibian我明白了。所以不可能在生成的请求中添加注释?不是afaik。不过,您可以使用一点xslt和那些注释生成一些非常棒的文档。@Namphibian请将此作为答案写下来,这样我就可以接受了。我已经这样做了。
<xsd:simpleType name="coffeetype">
    <xsd:restriction base="xsd:integer">

        <xsd:enumeration value="0" />
        <xsd:enumeration value="1" />
    </xsd:restriction>
</xsd:simpleType>
<xsd:element name="CoffeeRequestInput" nillable="false" type="tns:coffeetype">
    <xsd:annotation>
        <xsd:documentation>
          This object is the CoffeeRequestInput object is an Enumeration which can be used to determine is the user sending the request likes coffee or not. 
           Valid values for the enumeration is as follows:
           0 = like coffee
           1 = does not like coffee (probably a user not a programmer making a request).
           Some other things that you need to document goes here.
        </xsd:documentation>   
    </xsd:annotation>
</xsd:element>