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

前端之家收集整理的这篇文章主要介绍了春季-如何从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>
原文链接:https://www.f2er.com/spring/531867.html

猜你在找的Spring相关文章