【问题标题】:Create a WSDL from a sample SOAP transaction从示例 SOAP 事务创建 WSDL
【发布时间】:2014-03-07 05:06:55
【问题描述】:

我有一组几个示例 SOAP 事务,这是我如何构建 SOAP 客户端的唯一线索。

谁能告诉我我需要做什么才能得到:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://www.somecompany.com/api/soap12">
      <soapenv:Header>
        <soap:Authenticate>
            <Login>login</Login>
            <Password>password</Password>
        </soap:Authenticate>
         <soap:SetNamespace>
            <Namespace>item.id|item.item_num|{Namespace}</Namespace>
         </soap:SetNamespace>
      </soapenv:Header>
      <soapenv:Body>
         <soap:CreateItem>
            <Name>string</Name>
            <Data>
                <Id>integer {Item.Id}|integer {ItemNum}|string {ItemSync.Key}</Id>
                <ItemNum>integer</ItemNum>
                <Description>string</Description>
                <Cost>decimal</Cost>
                <ReplacementPrice>decimal</ReplacementPrice>
                <Notes>string</Notes>

                <!-- Depending on Namespace -->
                <Consignor>integer {User.Id}|integer {User.CustomerNo}|string {UserSync.Key}</Consignor>

                <Categories>
                    <!-- List category names  -->
                    <Category>string</Category>
                    <Category>string</Category>
                </Categories>

                <Images>
                    <!-- List of image names/ URLs  -->
                    <Image>string</Image>
                    <Image>string</Image>
                </Images>
            </Data>
         </soap:CreateItem>
      </soapenv:Body>
    </soapenv:Envelope>

到一个工作可用的 WSDL 文件? (我拥有的所有示例 SOAP 事务在结构上都相似,但操作不同,但类型/元素相似)

到目前为止,我已经能够为操作中的元素生成 xsd。

【问题讨论】:

    标签: web-services soap xsd wsdl schema


    【解决方案1】:

    我发现似乎没有一个简单的答案。虽然 xml 清楚地展示了 SOAP 事务,但没有一个自动化的过程来简单地从示例 SOAP 构建 WSDL 文件。

    我最终将 XML 拉回 XmlSpy 并使用它将 XML 转换为 XSD 文件。然后我从头开始手动编写 WSDL 文件,但只是将 XSD 引用为我的元素类型。

    【讨论】:

      猜你喜欢
      • 2014-05-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-09-23
      • 1970-01-01
      • 1970-01-01
      • 2011-10-26
      • 1970-01-01
      相关资源
      最近更新 更多