简体   繁体   中英

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)

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>
    <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"

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