找不到 WSDL 文件架构位置

发布于 2024-11-16 02:59:39 字数 4144 浏览 1 评论 0原文

在尝试使用soapUI时,我收到错误消息,指出它无法加载架构request.xsd 这是我的 wsdl 的样子:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
              xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
              xmlns:schema="http://www.myweb/xml/webservice"
              xmlns:tns="http://www.myweb.com/xml/webservice"
              targetNamespace="http://www.myweb.com/xml/webservice">
<wsdl:types>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
        <xsd:import namespace="http://www.myweb.com/xml/webservice"                      
            schemaLocation="/WEB-INF/schemas/Request.xsd"/>
    </xsd:schema>

这是我的 spring 配置文件的样子:

   <?xml version="1.0" encoding="UTF-8"?>
 <beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:sws="http://www.springframework.org/schema/web-services"
xmlns:context="http://www.springframework.org/schema/context"   
xmlns:aop="http://www.springframework.org/schema/aop"

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
   http://www.springframework.org/schema/aop
   http://www.springframework.org/schema/aop/spring-aop-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="mwsid" class="org.springframework.ws.wsdl.wsdl11.SimpleWsdl11Definition">
   <constructor-arg value="/WEB-INF/spring-ws.wsdl"/>
</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>


<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>

While trying to use soapUI I get the error message saying it fails to load the schema request.xsd
here is how my wsdl looks like:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
              xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
              xmlns:schema="http://www.myweb/xml/webservice"
              xmlns:tns="http://www.myweb.com/xml/webservice"
              targetNamespace="http://www.myweb.com/xml/webservice">
<wsdl:types>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
        <xsd:import namespace="http://www.myweb.com/xml/webservice"                      
            schemaLocation="/WEB-INF/schemas/Request.xsd"/>
    </xsd:schema>

and here is how my spring config file is:

   <?xml version="1.0" encoding="UTF-8"?>
 <beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:sws="http://www.springframework.org/schema/web-services"
xmlns:context="http://www.springframework.org/schema/context"   
xmlns:aop="http://www.springframework.org/schema/aop"

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
   http://www.springframework.org/schema/aop
   http://www.springframework.org/schema/aop/spring-aop-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="mwsid" class="org.springframework.ws.wsdl.wsdl11.SimpleWsdl11Definition">
   <constructor-arg value="/WEB-INF/spring-ws.wsdl"/>
</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>


<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>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

伪装你 2024-11-23 02:59:39

我假设您正在通过从本地磁盘选取 WSDL 来创建一个新的soapUI 项目。该工具正在读取文件,并在到达 /WEB-INF/schemas/Request.xsd 时停止,因为此路径告诉它转到根目录并查找名为 WEB 的目录-INF。在讨论案例时确保一致性也是明智的(文件显示 Request.xsd 但您的问题陈述显示 request.xsd;这在某些平台上很重要。

更改导入在 WSDL 中:

<xsd:import namespace="http://www.myweb.com/xml/webservice"                      
        schemaLocation="schemas/Request.xsd"/>

这假设 XSD 位于相对于 WSDL 的模式目录中。

I'm assuming that you're creating a new soapUI project by picking the WSDL off the local disk. The tool is reading the file and baulks when it gets to /WEB-INF/schemas/Request.xsd as this path tells it to go to the root directory and look for a directory called WEB-INF. It would also be wise to ensure consistency when discussing case (the file says Request.xsd but your problem statement says request.xsd; this matters on some platforms.

Change the import in the WSDL to:

<xsd:import namespace="http://www.myweb.com/xml/webservice"                      
        schemaLocation="schemas/Request.xsd"/>

This assumes the XSD is in the schemas directory relative to the WSDL.

倾城花音 2024-11-23 02:59:39

编辑您的配置文件并以完整路径说明架构位置。

Edit your configuration files and state the schema location in full path.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文