简体   繁体   中英

Problem exposing SPRING-WS WSDL, can't reach it with the url

I'm trying to generate and expose SOAP service with a WSDL using Spring-WS but I'm facing a problem, I get no error starting the server but I cannot reach the wsdl with his url.

I'm deploying a WAR File on a Tomcat just to precise.

So this is my web.xml where I define my 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>

And this is what's inside my spring-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>

I guess if the wsld generation was failing I would get an error message and I checked the file location, everything is in the correct place.

I'm trying to call my wsdl with this URL : http://localhost:8080/mamba/ws/soap/purge/v1/purgev1.wsdl (mamba is my context path) but I get only a 405 in return and no error message in my console, neither when I generate the wsdl so I'm a bit lost. I searched on the documentation and on many posts on the Internet but cannot find the solution.

Versions i'm using :

  • Java 1.8
  • Tomcat 8.5.40
  • Maven 3.3.9
  • Spring-WS 3.0.7.RELEASE
  • Spring-core : 5.2.2.RELEASE

If you have any idea, let me know. I thank you for the time you used for me.

Have a great day !

you have to mention the complete locationURI value in spring-ws-servlet.xml like /mamba/ws/soap/purge/v1/purgev1.wsdl generally locationURI parameter will expose your wsdl by prefixing hostname and port.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM