【问题标题】:SOAP UI not finding WSDL depending XSD files in Spring WS Soap ServiceSOAP UI 在 Spring WS Soap 服务中找不到 WSDL 依赖于 XSD 文件
【发布时间】:2015-02-26 19:34:43
【问题描述】:

我有一个 Spring SOAP Web 服务,它托管一个导入多个 XSD 文件的 WSDL。 WEB-INF文件夹里面的结构是这样的:

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

我正在使用 IntelliJ Idea Ultimate 运行该项目。项目运行正常,通过

可以看到wsdl
http://localhost:8080/sias.wsdl

但是当我尝试在 SoapUI 中生成 Web 服务测试时,我收到以下错误:

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

事实上,当我在浏览器中尝试该 URL 时,我得到一个 404 错误代码。

我怎样才能使 /WEB-INF/Esquemas/xsd/ 下的文件夹 xsd 准确可用通过 GET?

这是我的 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>

这是我的 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: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>

【问题讨论】:

    标签: spring web-services soap xsd wsdl


    【解决方案1】:

    我发现了问题。我使用旧版本生成 jaxb 类,使用新版本生成 SoapUi 请求。这两个版本的命名空间略有不同。

    【讨论】:

    • 我有同样的问题并尝试使用不同版本的 SOAP UI。但仍然给出同样的问题。我是春天的新手,不确定我的带注释的课程。我可以在浏览器中看到 WSDL 并尝试创建一个抛出错误的 SOAP 项目。它不能解析模式文件中的导入。 stackoverflow.com/questions/32127894/… 。您是否也可以分享剩余的课程。或分享示例项目。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多