Question

I have a group of several Sample SOAP transactions that are my only clue how to build a SOAP client.

Can any one walk me through what I would need to do to get from:

<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>

To a working usable WSDL file? (all the sample SOAP transactions I have are similar in structure with a different Operation but similar types/elements)

So far I've been able to generate the xsd for the elements in the operations.

Était-ce utile?

La solution

What I've found is that there doesn't seem to be an easy answer. While the xml clearly demonstrates the SOAP transactions, there isn't an automated process to build a WSDL file simply from sample SOAP.

What I ended up doing was pulling the XML back into XmlSpy and using that to convert the XML into XSD files. Then I manually wrote the WSDL file from scratch but just referenced the XSD as my element types.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top