Search code examples
springweb-servicessoapxsdwsdl

SOAP UI not finding WSDL depending XSD files in Spring WS Soap Service


I have a Spring SOAP Web service hosting a WSDL that imports several XSD files. The structure inside WEB-INF folder is as this:

WEB-INF
│   spring-ws-servlet.xml
│   web.xml
│
└───Esquemas
    │   composite.xml
    │   Esquemas.jpr
    │   EsquemasApplication.jws
    │   SIAS.wsdl
    │
    ├───src
    │   └───META-INF
    │           jps-config.xml
    │
    ├───xsd
    │   │   hello.html
    │   │   readme.txt
    │   │   SIAS.xsd
    │   │
    │   ├───common
    │   │       CommonInterchange.xsd
    │   │       CommonTypes.xsd
    │   │       IdentifyReply.xsd
    │   │       readme.txt
    │   │
    │   └───interchange
    │           CAEFF.xsd
    │           CSEFF.xsd
    │           readme.txt
    │
    └───xsl

I am running the project with IntelliJ Idea Ultimate. The project runs fine, and I can see the wsdl through

http://localhost:8080/sias.wsdl

but when I try to generate the webservice tests in SoapUI, I get the following error:

Error loading [http://localhost:8080/xsd/interchange/CAEFF.xsd]: org.apache.xmlbeans.XmlException: org.apache.xmlbeans.XmlException: error:

As a matter of fact, when I try that URL in the browser I get a 404 error code.

How can I exactly make the folder xsd under /WEB-INF/Esquemas/xsd/ available through GET?

This is my web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
             http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
         version="2.4">

    <display-name>Archetype Created Web Application</display-name>

    <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>*.wsdl</url-pattern>
    </servlet-mapping>

</web-app>

This is my spring-ws-servlet.xml file

<?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:mvc="http://www.springframework.org/schema/mvc"
   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
  http://www.springframework.org/schema/mvc
         http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd">

    <context:component-scan base-package="com.app.sample"/>

    <sws:annotation-driven/>


    <sws:static-wsdl id="sias"
                     location="/WEB-INF/Esquemas/SIAS.wsdl"/>

</beans>

Solution

  • I found the problem. I used an older version to generate jaxb classes and a newer version to generate the SoapUi request. The two versions had slightly different namespaces.