Having a widget extension return a Velocity data structure

Is there a method somewhere to allow a widget extension return a Velocity data structure? So for example in mostly-pseudocode terms,

#set ($options = $core_whatever_returns_a_dict())

For example, as the result of a web service call originated on the server side.

  • Any .NET object returned from a custom widget extension is already automatically accessible as a data structure within Velocity. So, if you return an object from a custom extension that, itself, calls a web service, this should already work.

    It's worth noting that 11 (or 12) may suit your needs better since it has built-in support for  performing HTTP requests  directly from script and support for server-side Javascript  as an alternative to Velocity to enable simpler server-side processing of those results along with widget-definable private APIs available to the rest of the widget.

    Hope this helps!