Variable parameters list in WSDL - wsdl

I need to implement a WSDL interface (HTTP binding) for a variable list function. What I need to do is something very similar to a wrapper for an ipothetic WSDL export of a printf function, in example. The parameters that i'll receive will have both a name and a value, and they are both not known in advance. So an input message could be like:
param1=value1
param2=value2
param3=value3
....
paramN=valueN
etc, and the name ("paramX"), the value ("valueX") and total number of parameters are not known.
What is the best way to model this kind of function with WSDL?
Thank you!

Pass an array of objects, each consisting of a name and a value.

Related

HashMap no instance key

What is wrong with my code?
widget.woList is this datatype List<HashMap<int, ABC>>()
for (var i in widget.woList) {
print(i.toString());
}
By printing above code, I get
{5838: ABC(pid: 84201,userId: 545)}
But when I want to get only key ( print(i.key.toString());), I get below error:
Class '_HashMap<int, ABC>' has no instance getter 'key'.
Receiver: Instance of '_HashMap<int, ABC>'
Tried calling: key
I think you need to loop through the HashMap as well:
for (HashMap<int, ABC> i in list) {
i.forEach((key, value) {
print(key.toString());
print(value.toString());
});
}
Make sure you typo the "i" variable in the for with HashMap<int, ABC> to get autocompletes from your IDE.
The analyzer should give an error in your case since a Map does not contain any property with the name key. Instead the name is keys which return a Iterable of keys in the map:
https://api.dart.dev/stable/2.8.1/dart-core/Map/keys.html
A map can contain multiple keys but if you know there are only one key in the map you can do something like: i.keys.first.toString(). But if there are multiple keys you need to loop through them.
I will recommend you use auto completion in your IDE when programming in Dart and make use of the analyzer. By using the tools the SDK provides, it is much easier to browse what properties and methods there are in each class together with the documentation. And since Dart can figure out the type of lots of variables automatically, you can use the IDE to also identify the type of each variable without even running the program.

How to set Flow variables with data returned from Function?

https://www.twilio.com/docs/studio/widget-library#run-function
When you invoke a Function, you have two possible options for using variables: (1) you can pass Flow variables as parameters into a Function (e.g. flow.data.foo), and (2) you may set Flow variables with data returned from the Function (TwiML or JSON can be returned).
Does anyone know how to set Flow variables with data returned from a Function?
You should be able to follow the Liquid Syntax documented here, to do so.
Liquid Template Language - Assigning Variables
https://www.twilio.com/docs/studio/user-guide/liquid-template-language#variable-assignment
Or just call the returned variable by addressing the Function widget as shown at the link below:
https://www.twilio.com/docs/studio/widget-library#run-function
widgets.MY_FUCTION_WIDGET_NAME.parsed.xxxxx (where xxxxx is the JSON path).
Alan

Enumerating swift method parameter names and values

I am looking for a way to enumerate swift method parameters, without explicitly naming them.
To be specific, I want to log all parameters in an arbitrary closure - preferably with both name and value. It would also be nice to have access to other meta-information about the current closure: name of method if any, return type, ...
Are there any ways to access this information?
Thanks!

T4MVC: What are MVC.Controller.ActionParams are for?

I've found properties corresponding to each action named like this: MVC.<Controller>.<Action>Params, they contain parameter names for each action. What are they for and how they can be used?
There were some edge scenarios where it was interesting to pass the parameter name as a constant. I can't instantly recall what that person was doing, but I could see this being useful is calls to AddRouteValue. In the end, it's all about never to have to use a literal string that refers to a C# object, whether it's a class, method, or param.

how does mvc HtmlHelper DisplayFor function extract the full property path from the lambda function?

I see that mvc is finding the names of the variables passed to it from the lambda function in an Html.DisplayFor method:
#Html.HiddenFor(model => myModel.propA.propB)
could generate HTML something like:
<input id="myModel_propA_propB" type="hidden" value="" >
it is obviously using reflection, but it is beyond me. could someone fill me in?
ALSO, is it possible to create an HTML helper function that takes a fully property reference instead of a lambda function to accomplish something similar? ie.
#Html.HiddenFor(myModel.propA.propB)
...and the helper could be passed the full "myModel.propA.propB" reference and not just the value of propB? is a lambda function an odd .net workaround to accomplish this sort of task or is it actually the preferred approach across all programming disciplines.
Actually, it is traversing the Expression tree you pass into helper method in order to get the property names. In practice, it would look something like:
MemberExpression memberExpression = (MemberExpression) expression.Body;
propertyName = memberExpression.Member.Name;
Of course that is not complete - for instance, you would have to walk up the chain of Expressions when there are multiple property invocations in the expression passed in, you would have to account for other expression types being passed in than MemberExpression, etc., etc. - but you get the idea. Remember that an Expression is a code expression represented as data. Also, since MVC is open source, you could look up the exact code they use to arrive at the html name in the sources, if you want.
To address your second question, the answer is no. Passing "just the property" without the lambda (which will be an Expression<Func<T,object>>), will not work, because then the function can only see the value passed in - and nothing about how the calling code arrived at that value.

Resources