java - spring-ws 错误动态创建 wsdl

标签 java web-services spring wsdl spring-ws

我想通过 spring-ws 自动创建我的 wsdl,并将下面的代码插入到我的应用程序上下文文件中,但出现错误;

“无法找到元素 [dynamic-wsdl] 的 BeanDefinitionParser”

这是什么意思以及我能做什么? tnx

<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:sws="http://www.springframework.org/schema/web-services"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org   /schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/web-services http://www.springframework.org/schema/web-services/web-services-2.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">


<bean id="payloadMapping"
       class="org.springframework.ws.server.endpoint.mapping.PayloadRootQNameEndpointMapping">
    <property name="defaultEndpoint" ref="inferenceEndPoint" />
    <property name="interceptors">
        <list>
            <ref local="validatingInterceptor" />
            <ref local="payLoadInterceptor" />
        </list>
    </property>
</bean>

<bean id="payLoadInterceptor"
    class="org.springframework.ws.server.endpoint.interceptor.PayloadLoggingInterceptor" />

<bean id="validatingInterceptor"
    class="org.springframework.ws.soap.server.endpoint.interceptor.PayloadValidatingInterceptor">
    <description>
        This interceptor validates the incoming
        message contents
        according to the 'Request.xsd' XML
        Schema file.
    </description>
    <property name="schema" value="/WEB-INF/schemas/Request.xsd" />
    <property name="validateRequest" value="true" />
    <property name="validateResponse" value="false" />
</bean>

<bean id="inferenceEndPoint" class="com.mywebsite.ws.web.InferenceEndPoint">
    <property name="messageService" ref="messageService" />
</bean>

<bean id="messageService" class="com.mywebsite.ws.service.MessageService">
    <property name="inferenceService" ref="inferenceService" />
</bean>

<bean id="schema" class="org.springframework.xml.xsd.SimpleXsdSchema">
    <property name="xsd" value="/WEB-INF/schemas/Request.xsd" />
</bean>

  <sws:dynamic-wsdl id="mtwsdl"
    portTypeName="mtWS"
    locationUri="http://localhost:8080/mws/">
<sws:xsd location="/WEB-INF/schemas/Request.xsd" />
   </sws:dynamic-wsdl>
<bean id="inferenceService" class="com.mywebsite.ws.im.InferenceService">
    <property name="webServiceConfiguration" ref="playerConfiguration" />
</bean>

<!-- <bean id="inferenceConfig" class="com.mywebsite.ws.im.InferenceService"> 
    <constructor-arg ref="playerConfiguration"/> </bean> -->

<!-- ~~~~~~~ Application beans ~~~~~~~ -->
<bean id="playerConfiguration"
    class="com.mywebsite.ws.configuration.WebServiceConfiguration"
    init-method="init">
    <property name="playerConfigXml" value="/WEB-INF/config/webserviceconfiguration.xml" />
    <property name="executingPathResource" value="/WEB-INF" />
    <property name="developmentMode" value="true" />
</bean>

最佳答案

替换您定义命名空间的应用程序上下文的第一部分:

<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:sws="http://www.springframework.org/schema/web-services"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/web-services http://www.springframework.org/schema/web-services/web-services-2.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">

关于java - spring-ws 错误动态创建 wsdl,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6369550/

相关文章:

java - minOccurs 和 maxOccurs

java - 如何使用java web服务从mysql数据库获取数据?

Spring Boot csrf使用

java - 不使用 web.xml 加载应用程序上下文

java - 使用 Stream 还是 Loop 之间的决定

c# - 在android和windows之间同步文件的最佳方式

java - 如何获取从客户端位置到服务器的正确时间

java - JPA查询问题

java - eclipse JDT AST : How to write generated AST to java file?

java - 我可以使用模拟检查数据库查询的返回值吗?