简体   繁体   English

在wsdl中找不到Soap Web服务模式位置

[英]Soap web service schema location can't be found in wsdl

My web service is as a jar file and being used as a plugin from another web application, so I have only one web.xml in the main web app and give referance to my dispatcher servlet, and it works good, but my problem is when I want to use it by using its wsdl file by a soap client(soapUI can not find the schemas in the wsdl) 我的Web服务是一个jar文件,并被用作另一个Web应用程序的插件,因此我在主Web应用程序中只有一个web.xml,并为我的调度程序servlet提供了依据,并且它运行良好,但我的问题是什么时候我想通过soap客户端使用它的wsdl文件来使用它(soapUI无法在wsdl中找到模式)

this is how my servlet.xml looks like in the jar file; 这就是我的servlet.xml在jar文件中的样子;

<bean id="schema" class="org.springframework.xml.xsd.SimpleXsdSchema">
    <property name="xsd" value="classpath:/resources/xwebservice/schemas/Request.xsd" />
</bean>

<bean id="mwsid"
    class="org.springframework.ws.wsdl.wsdl11.SimpleWsdl11Definition">
    <constructor-arg value="classpath:/resources/xwebservice/spring-ws.wsdl"/>
</bean>

And this is how my wsdl file looks like it's name is spring-ws.wsdl 这就是我的wsdl文件看起来像spring-ws.wsdl的名字

<wsdl:types>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
        <xsd:import namespace="http://www.mywebsite.com/xml/webservice"                      
            schemaLocation="/resources/xwebservice/schemas/Request.xsd"/>
    </xsd:schema>

This can not find the request.xsd schema when I try to access my webservice using a soap client(soapUI) by showing my wsdl url address, which is; 当我尝试使用soap客户端(soapUI)通过显示我的wsdl url地址访问我的web服务时,找不到request.xsd模式,这是;

http://localhost:8080/mwp/mws/mwsid.wsdl

The wsdl and schema files are on different folders in my web service plugin jar, where is my mistake? wsdl和schema文件位于我的web服务插件jar中的不同文件夹中,我的错误在哪里? I can expose the wsdl in browser by the url above, but soap client cant find the schemas in the path. 我可以通过上面的url在浏览器中公开wsdl,但是soap客户端无法在路径中找到模式。

Thanks 谢谢

The SimpleXsdSchema exposes the schema as the name of the bean plus .xsd (in this case schema.xsd). SimpleXsdSchema将模式公开为bean的名称加上.xsd(在本例中为schema.xsd)。 So you have to update the WSDL to point to it: 所以你必须更新WSDL以指向它:

schemaLocation="schema.xsd"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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