Announcement Announcement Module
Collapse
No announcement yet.
Use of property placeholders in a non-Spring XML file Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Use of property placeholders in a non-Spring XML file

    We have built an application that communicates with a webservice. The webservice uses the WSIT framework to implement security, and our client has an XML file with the proper configuration settings.

    The file looks like this
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
        xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
        name="mainclientconfig">
        
        <import location="signatureService.xml" namespace="http://signature.my.domain.com" />
        <import location="queryService.xml" namespace="http://query.my.domain.com" />
        <import location="utilService.xml" namespace="http://util.my.domain.com" />
    </definitions>
    The three XML files that are called by the <import... tags should be different depending on the environment (dev, test, prod). The application run in a JVM with an argument set; something like -Denvir=prod.
    If it were a Spring file, I could use a placeholder and it would become something like
    Code:
        <import location="${envir}-signatureService.xml" namespace="http://signature.my.domain.com" />
        <import location="${envir}-queryService.xml" namespace="http://query.my.domain.com" />
        <import location="${envir}-utilService.xml" namespace="http://util.my.domain.com" />
    I suppose this wont work for me since my XML file is not a Spring file.
    Is there any way that Spring could be of service to solve this problem? Or any alternative is welcome.
Working...
X