Highlighted

How to create a well-defined SOAP method definition?

lukkyluke

09-01-2019

Hi all,

So far we have been defining complex method responses as DOMElements.

Example:

<method library="xxx:customFunction.js" name="getEntity" static="true">

  <parameters>

   <param inout="in" label="Target ID" name="targetId" type="string"/>

   <param inout="in" label="Max count to be returned" name="maxCount" type="byte"/>

   <param inout="out" label="Response Xml" name="response" type="DOMElement"/>

  </parameters>

</method>

However, it would be much more convenient to be able to write a more well-defined response. For example when other third parties want to automatically generate classes from the Adobe Campaign wsdl. The usage of DOMElement (above) does not give us a well-defined response about the following information:

<SOAP-ENV:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema​"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance​"

xmlns:ns="urn:nms:propositionRcp" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">

   <SOAP-ENV:Body>

      <getEntityResponse SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"

      xmlns="urn:nms:propositionRcp">

         <response xsi:type="ns:Element"

         SOAP-ENV:encodingStyle="http://xml.apache.org/xml-soap/literalxml">

            <entities>

               <entity id="1">

                  <title>TestTitle</title>

                  <shortText/>

                  <text>TestText</text>

                  <icon>2</icon>

               </entity>

               <entity id="2">

                  <title>TestTitle</title>

                  <shortText/>

                  <text>TestText</text>

                  <icon>1</icon>

               </entity>

            </entities>

         </response>

      </getEntityResponse>

   </SOAP-ENV:Body>

</SOAP-ENV:Envelope>

I am thinking of something like this:

    <method library="xxx:customFunction.js" name="getEntity" static="true">

      <parameters>

        <param inout="in" label="Target ID" name="targetId" type="string"/>

        <param inout="in" label="Max count" name="maxCount" type="byte"/>

        <param inout="out" label="entities" name="entities" type="DOMElement">

          <param inout="out" label="entity" name="entity" type="DOMElement">

            <param inout="out" label="title" name="title" type="string"/>

            <param inout="out" label="shortText" name="shortText" type="string"/>

            <param inout="out" label="text" name="text" type="string"/>

            <param inout="out" label="icon" name="icon" type="string"/>

          </param>

       </param>

      </parameters>

    </method>

Has anyone been able to accomplish this?

Looking forward to your response

Replies

Highlighted
Highlighted
Highlighted