我無法訪問XSD架構。下面是我的配置:公開並訪問Spring WS 2中的靜態XSD架構
的web.xml
<servlet>
<servlet-name>spring-ws</servlet-name>
<servlet-class>org.springframework.ws.transport.http.MessageDispatcherServlet</servlet-class>
<init-param>
<param-name>transformWsdlLocations</param-name>
<param-value>true</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>spring-ws</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
彈簧WS-servlet.xml中
<sws:annotation-driven/>
<context:component-scan base-package="example.ws.endpoint"/>
<sws:dynamic-wsdl id="boo"
portTypeName="BooResource"
locationUri="/services/">
<sws:xsd location="classpath:example/ws/schema/Boo.xsd"/>
</sws:dynamic-wsdl>
WSDL是[HTTP訪問://本地主機:端口/彈簧WS- server-0.1-SNAPSHOT/services/boo.wsdl],但是我怎樣才能公開XSD以及URL是什麼?
不知道爲什麼這是被接受的答案,因爲你實際上可以做到這一點。請參閱@evandongen答案或https://stackoverflow.com/a/42724574/1766166。 – zygimantus 2018-02-07 12:11:18