WSDL:从属性文件中读取值

时间:2015-08-18 05:23:32

标签: spring web-services maven java-ee wsdl

我在web-inf / wsdl下有wsdl文件,我想从wsdl中的属性文件中读取值,如下所示:

Opacity

例如:URL.properties

val conf = new SparkConf().setAppName("Simple Application").setMaster("local[*]")

Spring.xml

<wsdl:types>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
attributeFormDefault="unqualified" elementFormDefault="qualified">
<xs:import namespace="http://ws.com/" 
schemaLocation="${ws.url}">
</xs:import>
</xs:schema>
</wsdl:types>

请帮忙。

由于

1 个答案:

答案 0 :(得分:1)

您可以在构建过程中在静态文件中使用maven到filter properties。对于您的示例,您可以使用属性文件中的相应值替换WSDL中的${ws.url}占位符,方法是在POM中包含类似于以下内容的内容:

<build>
    <filters>
        <filter>src/main/config/URL.properties</filter>
    </filters>
    <resources>
        <!-- replace matching URL.properties in MyWS.wsdl -->
        <resource>
            <directory>src/main/webapp</directory>
            <filtering>true</filtering>
            <includes>
                <include>WEB-INF/wsdl/MyWS.wsdl</include>
            </includes>
        </resource>
        <!-- include all other webapp content unfiltered, to avoid corrupting content -->
        <resource>
            <directory>src/main/webapp</directory>
            <filtering>false</filtering>
            <excludes>
                <exclude>WEB-INF/wsdl/MyWS.wsdl</exclude>
            </excludes>
        </resource>
    </resources>
</build>