从示例SOAP事务创建WSDL

时间:2014-03-01 00:41:35

标签: web-services soap xsd wsdl schema

我有一组示例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。

1 个答案:

答案 0 :(得分:0)

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

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

相关问题