

Something a little more elaborate than that. If you show me the specific desired output SOAP message and a specific (actual) JSON inbound message, I can show you some examples of the above.


Handlebars - or a similar templating model. XSLT is also helpful when there will be loops or repeats of an indeterminate size.Į4X - which is a program model you can use from a JavaScript program to construct XML documents. You can use the xsl:if and xsl:choose mechanisms to accommodate this. For example, depending on the inbound (JSON) payload the output (SOAP) may be structured differently. This is helpful when the resulting output SOAP message is of a non-determinant shape. If you'd prefer, you can use an XSLT sheet to do effectively the same thing. The result will be a correct SOAP message. That means you can basically specify a "template" of what you want the resulting SOAP message to be, then within that template, insert references to the fields in the JSON payload. The AssignMessage configuration accepts a Payload element, which itself is a "message template". Which you will prefer, depends on those inputs. Depending on your goals and your aptitudes, I'd recommend one over the other. There are multiple ways to do what you are describing. I've modified the attached example to include this option as well. the fee property is an array of childrenĬtVariable(properties, s) Var catNs = new Namespace('cat','urn:my-namespace-urn') Var message = context.getVariable(properties) Return s.charAt(0).toUpperCase() + s.slice(1) the JS policy might look like this:Īnd the actual JS code would be like this: In other words you could do the three things : capitalize, convert to XML, and insert namespaces. Thinking about this further, you could do this in one step, using JavaScript callout, taking advantage of the E4X capability in the JavaScript. I am certain that the example you showed me is not "the whole problem." So you'll need to adapt this example proxy to meet your needs. transform the XML into the right structure with the namespace prefix and a namespace Įxample invocation to demonstrate your case:.convert the JSON properties to "capitalized" forms.
