Placeholder values in service definition 'location' attribute

I am trying to create a remote-rest service with a placeholder value for the url, but the placeholder is null.

Configuration:

<service verb="get" noun="ReceivedInvoices" type="remote-rest"
             location="${ANAF_CONNECTOR_BASE_URL}/invoices/search/between" method="get">
        ...
    </service>

And in MoquiConf.xml:

<default-property name="ANAF_CONNECTOR_BASE_URL" value="https://localhost:8083"/>

Expected result
Location should resolve to https://localhost:8083/invoices/search/between
Actual result
Location resolves to null/invoices/search/between

As per the documentation I also tried to add the following in the MoquiConf.xml:

<service-facade>
        <service-location name="ANAF_CONNECTOR_BASE_URL" location="https://localhost:8083"/>
    </service-facade>

but still the same null result.

Any idea on the correct syntax to make placeholder values work?

Hello

Try to get the value using ${System.getProperty(‘ANAF_CONNECTOR_BASE_URL’)}

1 Like

Yes indeed this one seems to work, thank you! I think I also tried this one but I was having trouble with the quotes, could not escape them inside xml. Your solution with single quote ' works, also double quote using &quot; seems to work.