2011-04-21 40 views
0

這裏是我的WSDL:WSDL schemaLocation:是否可以使用相對路徑將.xsd導入到.wsdl中?

<?xml version="1.0" encoding="UTF-8"?> 

<wsdl:definitions targetNamespace="http://xxx" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:ns0="http://xxx/commun/axis" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://xxx" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> 

    <wsdl:types> 
      <xsd:schema targetNamespace="http://xxx/commun/axis" xmlns="http://www.w3.org/2001/XMLSchema"> 
       <xsd:include schemaLocation="https://host:port/path/WebServices/wsdl/typesServicesApplicatifs.xsd"/> 
(...) 

的typesServicesApplicatifs.xsd文件在同一目錄中的WSDL文件(戰爭中),是有可能TU使用相對路徑,而不是絕對路徑爲模式位置 ?

這將是非常有用的,因爲現在,schemaLocation在每個環境(主機和端口都必須指定)上是不同的。

編輯:這個問題是一樣的,在這個線程的最後一個(無答案):http://forum.springsource.org/showthread.php?p=342542

回答

0

這是一種方式來實現這一目標:

使用Spring-WS的WSDL

<sws:dynamic-wsdl id="holiday" portTypeName="HumanResource" **locationUri="/holidayService/"** targetNamespace="http://mycompany.com/hr/definitions"> 
    <sws:xsd location="/WEB-INF/hr.xsd"/> 
</sws:dynamic-wsdl> 

源:http://static.springsource.org/spring-ws/site/reference/html/tutorial.html#tutorial-publishing-wsdl

釷可以從自動生成是方式,主機,端口和上下文路徑不需要在WSDL內部指定。

相關問題