开发者

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

开发者 https://www.devze.com 2023-03-13 00:38 出处:网络
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,

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)

this is how my servlet.xml looks like in the jar file;

<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:types&g开发者_高级运维t;
    <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;

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? I can expose the wsdl in browser by the url above, but soap client cant find the schemas in the path.

Thanks


The SimpleXsdSchema exposes the schema as the name of the bean plus .xsd (in this case schema.xsd). So you have to update the WSDL to point to it:

schemaLocation="schema.xsd"
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号