我正在開發與JAX-WS的WebService(我在jaxws-maven-plugin上使用wsimport目標)。我編寫了一個導入XSD模式的WSDL。xsd架構不提供wsdl
WEB-INF/wsdl/service.wsdl
WEB-INF/wsdl/service.xsd
此外我生成的Web服務類和創建端點和所有。到目前爲止,一切都很好。當我在Tomcat 7上運行我的服務時,一切都很好。我可以從我的瀏覽器訪問wsdl:
http://localhost:8080/webService/servlet-url?wsdl
但我無法訪問xsd模式。問題是,在這個WSDL:
<xsd:schema>
<xsd:import namespace="http://ws.service/domain/1.0" schemaLocation="service.xsd"/>
</xsd:schema>
當然代班WSDL和XSD的過程是本地路徑上,但我希望他們的網絡服務正在運行時被遠程訪問。我知道schemaLocation應該是這樣的「http:// localhost:8080/webService/servlet-url?xsd = 1」。
在WSDL在瀏覽器中輸入呈現schould樣子:
<xsd:schema>
<xsd:import namespace="http://ws.service/domain/1.0" schemaLocation="http://localhost:8080/webService/servlet-url?wsdl&resource=service.xsd"/>
</xsd:schema>
本地主機:8080/web服務/ servlet的WSDL給我:
wsdl:definitions targetNamespace="http://ws.serv.com/Service/1.0" name="emuiaService">
<wsdl:types>
<xsd:schema>
<xsd:import namespace="http://ws.serv.com/Service/domain/1.0" schemaLocation="schema.xsd"/>
</xsd:schema>
</wsdl:types>
<wsdl:message name="halloMsg">
<wsdl:part name="parameters" element="dom:halloRequest"/>
</wsdl:message>
<wsdl:message name="halloResponseMsg">
<wsdl:part name="return" element="dom:halloResponse"/>
</wsdl:message>
等等...
我真的不記得我做了什麼...可能切換到最後合同,但感謝您解決它。我希望有一天能幫助別人;) – bemol