暴露 SPRING-WS WSDL 时出现问题,无法使用 URL 访问它



>我正在尝试使用 Spring-WS 使用 WSDL 生成和公开 SOAP 服务,但我遇到了一个问题,启动服务器时没有错误,但我无法使用他的 url 访问 wsdl。

我正在Tomcat上部署一个WAR文件,只是为了精确。

所以这是我的网络.xml我定义我的servlet

<servlet>
<description>Servlet pour l'exposition du webservices SOAP de purge</description>
<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>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>spring-ws</servlet-name>
<url-pattern>/ws/*</url-pattern>
</servlet-mapping>

这就是我的弹簧-ws-servlet里面的东西.xml

<?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:context = "http://www.springframework.org/schema/context"
xmlns:sws = "http://www.springframework.org/schema/web-services"
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">
<context:component-scan base-package = "com.alm.*"/>
<sws:annotation-driven/>
<context:property-placeholder location="classpath:purge.properties" />
<sws:dynamic-wsdl id = "purgev1"
portTypeName = "purgev1Port"
locationUri = "/ws/soap/purge/v1/" 
<sws:xsd location = "classpath:xsd/purgev1.xsd"/>
</sws:dynamic-wsdl>
</beans>

我想如果 wsld 生成失败,我会收到一条错误消息,我检查了文件位置,一切都在正确的位置。

我正在尝试使用此 URL 调用我的 wsdl:http://localhost:8080/mamba/ws/soap/purge/v1/purgev1.wsdl(mamba 是我的上下文路径(,但我只得到一个 405 作为回报,在我的控制台中没有错误消息,当我生成 wsdl 时也没有,所以我有点迷茫。我在文档和互联网上的许多帖子上搜索了搜索,但找不到解决方案。

我正在使用的版本:

  • 爪哇 1.8
  • 雄猫 8.5.40
  • Maven 3.3.9
  • 春季-WS 3.0.7.发布
  • 弹簧芯:5.2.2.发布

如果您有任何想法,请告诉我。 我感谢你为我使用的时间。

祝你有美好的一天!

你必须提到spring-ws-servlet中完整的locationURI值.xml比如/mamba/ws/soap/purge/v1/purgev1.wsdl通常locationURI参数将通过前缀主机名和端口来公开你的wsdl。

http://localhost:8080/mamba/ws/soap/purge/v1/purgev1.wsdl

最新更新