2011-06-16 43 views
2

試圖使用的soapUI我收到錯誤消息說它無法加載架構request.xsd 這裏是我的WSDL看起來像: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> 

+0

那麼它現在正在工作嗎? – abalogh 2011-06-16 11:40:14

+0

不,不會..會變得很瘋狂 – Spring 2011-06-16 12:11:15

+0

你準確的彈簧-WS罐子? – abalogh 2011-06-16 13:12:36

回答

3

我假設你通過從本地磁盤中選擇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的模式目錄中

0

編輯您的配置文件,並說明在全路徑模式位置。

+0

「編輯文件」是什麼意思?我知道我必須編輯一些東西,但不知道如何。 – Spring 2011-06-16 12:08:39