【问题标题】:Adding annotation and documentation child elements to Coldfusion generated WSDL向 Coldfusion 生成的 WSDL 添加注释和文档子元素
【发布时间】:2016-05-12 19:58:02
【问题描述】:

我正在开发一个 ColdFusion SOAP Web 服务,但我不知道如何将注释子元素和文档子元素添加到生成的 WSDL。

这是我的预期输出:

<xsd:element name="country" minOccurs="1" maxOccurs="1">
    <xsd:annotation>
        <xsd:documentation>The ISO 3166-1 alpha-2 country code
        </xsd:documentation>
    </xsd:annotation>
    ....                                
</xsd:element>

我的 ColdFusion 生成的 WSDL 如下所示:

<xs:element minOccurs="0" name="country" nillable="true" type="xs:string"/>

我在 cfcomponent > cffunction 中定义了这样的参数:

<cfargument name="country" type="string" required="true" default="" hint="The ISO 3166-1 alpha-2 country code"/>

使用提示属性不会添加注释和文档子元素,但我在 ColdFusion 文档中找不到其他方法来实现这一点。

在寻找答案时,我看到 ColdFusion SOAP Web 服务被描述为“半生不熟”。尝试这个是不是让我自己失败了?

【问题讨论】:

    标签: web-services soap coldfusion wsdl


    【解决方案1】:

    如果要控制 ColdFusion 生成的 WSDL,可以使用 cfcomponent 标签的 wsdlfile 属性来使用预定义的 WSDL 文件,而不是使用 ColdFusion 生成的 WSDL 文件。

    来自Producing WSDL files 页面:

    为了完全控制 WSDL,高级用户可以指定 cfcomponent wsdlFile 属性来使用预定义的 WSDL 文件。

    来自cfcomponent documentation page

    wsdlfile - 可选 - 使用格式正确的 WSDL 文件,而不是 ColdFusion 生成的 WSDL。

    您很可能需要稍微尝试一下才能获得所需的输出。我不久前发布了另一个类似问题的答案 - https://stackoverflow.com/a/17174756/1636917 请注意那里发布的关于需要在 WSDL 中的端点 URL 的评论。

    【讨论】:

    • 谢谢你,米格尔。感谢您为我指明正确的方向。我采用 ColdFusion 生成的 WSDL,保存它,添加注释,并按照您的建议将 wsdlfile 属性添加到 cfcomponent 标记。
    猜你喜欢
    • 2021-10-29
    • 1970-01-01
    • 2011-12-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多