Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

How to create a well-defined SOAP method definition?

lukkyluke
Level 3
Level 3

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

4 Replies
Jonathon_wodnicki
Community Advisor
Community Advisor

Hi,

Output fields can only be at the top level.

Thanks,

-Jon

lukkyluke
Level 3
Level 3

Hi and thanks for your reply. I have noticed that it does not work but I am looking for a workaround

Jonathon_wodnicki
Community Advisor
Community Advisor

No real workaround, you can create your own soap endpoint with jssp's and blackjack if it's really needed.

Florian_Courgey
Community Advisor
Community Advisor

Hi wodnicki,

I'm interested in this question, what's blackjack? I googled it but it's too broad

Thanks