Can all parameters from axis2.xml be overridden in services.xml - java

I've trying to move parameters from axis2.xml to be specific to a single service by putting them in services.xml
I've tried this by moving false
and it doesn't work.
Any tips on what I'm doing wrong? Is there any reason why parameters can't be moved in this way?

Instead of moving the parameter from axis2.xml try to override that same parameter by adding parameter with the same name and a different value in services.xml
Also refer this small tutorial.

Related

Overriding application.property from env.properties as null

I have a DB connection using separated properties.
serverName=MyServerName
databaseName=MyDbName
instance=MyInstance
I want to override these with env.properties and this is working however the 'instance' property needs to be left blank. I've tried passing in the env.properties with a blank entry for 'instance' however it does not override the default 'MyInstance' (others are overridden fine).
Is this possible? If so, please may you give an example?

REST is recognized by wrong (partially right) class, how to prevent from this?

I've got
#Path("web-filters/wizard/{type}/{id}/clone") annotation on one class
and
#Path("web-filters/wizard/filters") annotation on the other class.
filters can be passed as type path param.
And my problem is that REST i.e. host-and-etc/web-filters/wizard/filters/123/clone tries to found a path in the second class, co I've got 404. Is there an option to prevent from this?
I can move RESTs from first to second resource, but that is not what I want to do, at least I wish I can do it smarter.

How to pass arguments to javascript function call when using onClick in Thymeleaf

I have been calling my javascript function from Thymeleaf as below:
th:onclick="'viewDocument(\'' + ${document.docTypeLongDesc} +'\');'"
But I just updated my spring boot version to 2.1.4 RELEASE with which Thymeleaf also got updated. And the previous version in no longer supported.
On further research I found out that I should be able to use
th:onclick="' viewDocument (this.getAttribute ('document.docTypeLongDesc'));'"
However, it doesn't give any error but neither does it work. I have removed the argument and was able to call the function just fine. So I am guessing I am not passing the argument right way. Any guidance will be helpful. TIA.
See this: Restricted mode: Avoid variable expressions returning strings in processors for event handlers (th:on*).
In order to correctly pass Thymeleaf variables to the onclick event, put the variable in a data attribute, and read it using getAttribute().
th:data-longDescription="${document.docTypeLongDesc}" onclick="viewDocument(this.getAttribute('data-longDescription'));"
You should use it as follows:
th:onclick="${'viewDocument(' + document.docTypeLongDesc + ');'}"

How to pass parameters into Mule ESB flow xml?

Its pretty new this Mule ESB to me. I am trying to pass parameter from the flow xml itself. Once flow started, then doTransform() method invoked and the logic inside it will be executed accordingly based on the parameter passed.
My concern is "How to pass parameter? and How can I access it from that method?"
Is there any other way please do suggest.
Thanks in Advance
Using method entry point resolver you can call a method and pass parameter.
Share your config for further help.
message.getProperty("yourVariableName", PropertyScope.SESSION);
you can use various scope here like OUTBOUND,INVOCATION,INBOUND,SESSION etc.

How to check if endpoint was used in a munit test

I am trying to write a mule munit test (in java) and I would like to check whether the message passed (or in this case exited) through a specific outbound-endpoint since there is routing in the flow and the message can pass through different ones depending on conditions?
My setup is to actually use 2 different flow files, one with the flow logic which uses generic endpoints such as
<outbound-endpoint ref="out.endpoint" />
And then another flow file with the actual endpoint definition such as
<vm:endpoint name="out.endpoint" path="out.path" />
The following java code works
verifyCallOfMessageProcessor("outbound-endpoint").times(1);
However I'd like to be able to specify the specific name of the endpoint. I have tried the following but none worked
verifyCallOfMessageProcessor("outbound-endpoint").withAttributes(attribute("name").withValue("out.endpoint")).times(1);
verifyCallOfMessageProcessor("outbound-endpoint").withAttributes(attribute("ref").withValue("out.endpoint")).times(1);
verifyCallOfMessageProcessor("endpoint").withAttributes(attribute("name").withValue("out.endpoint")).times(1);
verifyCallOfMessageProcessor("endpoint").withAttributes(attribute("ref").withValue("out.endpoint")).times(1);
All these 4 (Which are the ones that would make any sense to me) fail. Does anybody know how to accomplish this (Preferably through java otherwise using xml)?
This should be the way:
verifyCallOfMessageProcessor("outbound-endpoint").ofNamespace("vm").withAttributes(attribute("name").ofNamespace("doc").withValue("out.endpoint")).times(1);
Check that the attribute name has the namespace "doc.

Categories