且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

WSDL schemaLocation:是否可以使用相对路径将 .xsd 导入到 .wsdl 中?

更新时间:2022-11-28 12:38:17

这是实现此目的的方法:

Here is a way to achieve this :

使用 Spring-WS,可以从以下位置自动生成 WSDL:

Using Spring-WS, the WSDL can be generated automatically from :

<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 中指定.

This way, the host, port and context path don't need to be specified inside the WSDL.