微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

春季-如何从wsdl文件中的属性文件读取?

我在src / wsdl下有wsdl文件,我想知道是否有可能从wsdl文件中的属性文件中读取值,如下所示:

<?xml version="1.0" encoding="UTF-8"?><!-- Published by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.1.3-b02-. --><!-- Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.1.3-b02-. --><deFinitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://AXLInterface.jaxws.AllInOne.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://AXLInterface.jaxws.AllInOne.org/" name="AXLInterfaceService">
<types>
<xsd:schema>
<xsd:import namespace="http://AXLInterface.jaxws.AllInOne.org/" schemaLocation="${wsdl.url}/AXLInterface?xsd=1"></xsd:import>
</xsd:schema>

</deFinitions>

我在applicationContext中定义了PropertyPlaceholderConfigurer,如下所示:

<bean id="propertyConfigurer"
        class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="locations">
            <list>
                <value>classpath:messages/application.properties</value>
                <value>file:${APP_HOME}/Common/Conf/app.properties
                </value>
            </list>
        </property>

        <property name="ignoreResourceNotFound" value="true" />
        <property name="searchSystemEnvironment" value="true" />
        <property name="systemPropertiesModeName" value="SYstem_PROPERTIES_MODE_OVERRIDE" />
    </bean>

当我尝试编译应用程序时,wsdl文件中出现错误

[ERROR] Unable to parse "${wsdl.url}/AXLInterface?xsd=1" : Illegal character in path at index 1: ${wsdl.url}/AXLInterface?xsd=1

[ERROR] java.net.URISyntaxException: Illegal character in path at index 1: ${wsdl.url}/AXLInterface?xsd=1

请告知如何完成此任务,谢谢.

最佳答案
只需将WSDL文件定义为资源,以便Maven激发它.但是属性值应该在Maven概要文件中,而不是在属性文件中.

<resource>
    <directory>src/wsdl</directory>
    <filtering>true</filtering>
</resource>

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐