Passing empty value to DBReport mediator - wso2-esb

Is there a way to pass null parameter to sql query using DBReport mediator?
I get empty value for my soap property and WSO2 fails.

If its is null use filter mediator to check the null and then use dbreport mediator.

Related

how to read a property's value of value in Mule4?

I have a property defined in properties file.Note client1 prefix, which is calculated dynamically when request hits.
client1_appilicationid=OBCDSEFT
i have 2 variables defined in my flow;
<set-variable value="#[attributes.headers.'x-client-id']" doc:name="ClientId" doc:id="1e33f179" variableName="clientid"/>
Here attributes.headers.'x-client-id' =client1
<set-variable value="'#[vars.clientid]'++'_'++'applicationid'" doc:name="applicationId" doc:id="9df0420e" variableName="applicationid"/>
In the above if i access #[vars.applicationd] it will print client1_appilicationid as value. but i want 'OBCDSEFT' as value. How I can define applicationId variable to get that?
You are just concatenating the client id header value with the suffix, however that will not read a property value. You should use the p() function to read properties values.
The expression should be something like this: #[p(vars.clientid++'_'++'applicationid')]

mule: how to add value to payload array list

I have a payload as list of maps and another flow variable as map.
I wanted to add flow variable to payload list. I tried using this expression #[payload.addAll(flowVars['entitlement'])]in expression component. But it sets the payload to boolean value true.
Use expression component like
<expression-component doc:name="Expression"><![CDATA[payload.addAll(flowVars['entitlement'])]]></expression-component>
Hope this helps.
Try using Set Payload transformer.
and add
[payload.addAll(flowVars['entitlement']) as value.
You set the payload as the value returned by addAll(). It's like doing payload = payload.addAll(flowVars['entitlement']) in Java addAll() returns a boolean, that's why your payload becomes true.
You can use instead:
#[payload.addAll(flowVars['entitlement']); payload)
This will perform your addAll() operation on your payload and then return this modified payload afterward. ; allow your to perform multiple expressions in MEL
You can use dataweave transform component and add the elements in various ways like using the ++ operator or use map operator to change the structure as per your requirements.

Mulesoft MEL Expression Get String Value Of Payload Data Type

I want to extract my payload's class name in a MUnit assert so I can verify the payload is always of the correct type. I've tried 2 MEL expressions, but both return null in the MEL expression evaluator. The funny thing is that if I remove the .name part of the expression then I see a key called "name" with the value that I need. Any ideas?
payload.class.name
message.dataType.type.name
One way is: #[payload.getClass().getSimpleName()]

Passing a default Integer value to a WCF service in Biztalk

I have consumed WCF service in biztalk through "Add generated items". There is a method in WCF which takes an integer parameter. In orchestration I want to pass that method a default value or say I want to hard code input value. How I can achieve this. I have googled this question but didn't get any adequate result.
What I have done is declared an integer variable assign it a value, then I assigned that variable to a message of Integer type.
Now how I can assign this message to WebService Request type message?
or how I can transform integer type message to WebService Request type message?
There are a bunch of ways to do this:
If you are mapping the request from another message, you can hard code it in the map - click on the field in the RHS of the Map Editor and set the hard coded value in the Value in the Property box
After creating a (dummy) request message, you can set the value using xpath() in an expression message assignment shape
xpath(myRequestMessage, "//*[local-name()='NameOfFieldHere']") = 3; // Or set to it your variable
If the field is distinguished in your schema, you can use the distinguished field instead of xpath, viz in an expression message assignment shape:
myRequestMessage.NameOfFieldHere = 3;
(And note if its a multipart message, then it will be myRequestMessage.Part.NameOfFieldHere OFC)
One disclaimer: I've assumed the WCF service request message is trivial, i.e. just a single integer field. If your message is large, using //local-name() ... isn't recommended, since
There may be more than one node with with the name NameOfFieldHere
The XSL parser used by BizTalk is slow and resource intensive when evaluating large xml documents with //
Biztalk Scheduler Adapter is really helpful in this case. It generates desired XML on predefined scheduled set by the user. So fill up your XML with hard coded values and receive them through this adapter.

oData operation consumption with objective-C

I have a really simple WCF service operation GetCurrentBalance. It returns a decimal.
I also have the odatagen generated entity files included in the project, which contains an implementation of the GetCurrentBalance operation returning a string. Calling this method returns me an XML string with the desired value in it.
I also tried using executeServiceOperation method in the generated class and pass in the operation name as a parameter, the returned value again is the same XML string.
Is there a way to extract this value? Or do I have to write a custom parser for it?
Thanks in advance.
Without further informations, if the returned value is a formatted XML string you may try extracting the value using XPath queries, have a look at this to get you started