Can any CXF developers have a look this issue? Thanks!
---------- Forwarded message ---------- From: Min Yang <[email protected]> Date: Wed, Nov 7, 2012 at 8:12 PM Subject: WSDL Schema Imports Issues still exist To: [email protected] Dear CXF Developers, I noticed that a similar issue CXF-1822<https://issues.apache.org/jira/browse/CXF-1822>about schema import reported before, and has been fixed several years ago, but recently I still met such issue in my test. I just tried to access the wsdl generated by the WebSphere Application Server(WAS) runtime, with the annotation WebServiceRef(wsdlLocation=" http://localhost:9080/TestClient/TestService?wsdl") in the client application using CXF, it showed the accessed wsdl can not be parsed as a well-formed document and throw the exception until I set the HTTPConduit property "AutoRedirect" as true, since the given wsdl url on WAS is not the final url and would be redirect to another url " http://localhost:9080/Test/TestService/TestService.wsdl". After correct the redirection issue, another exceotion was occurred, and showed the schema imported in the wsdl can not be accessed, with the error message: HTTP response '404: Not Found' when communicating with http://localhost:9080/TestClient/TestService_schema1.xsd. Actually the schema url CXF accessed is wrong, the correct schema url should be " http://localhost:9080/TestClient/TestService/TestService_schema1.xsd". After trace the CXF code, I found CXF passing the wsdl url " http://localhost:9080/TestClient/TestService?wsdl" into class org.apache.cxf.transport.TransportURIResolver as the base uri of the schema location, so the final accessed schema url is " http://location:9080/TestClient/TestService_schema1.xsd", but correct url should be " http://location:9080/TestClient/TestService/TestService_schema1.xsd". I am not sure if this is the CXF defect, please help to review and help us to solve such issues. In summary, the CXF can work fine when I access the final url " http://localhost:9080/Test/TestService/TestService.wsdl", but if I accessed the url " "http://localhost:9080/Test/TestService?wsdl", which will be redirected to the final url, then the schema import issue will be occurred after open the AutoRedirection option. The attachments are the wsdl file and error log. Hope the information I provide you can help you to reproduce the issue. Another information you needed please let me know. Thanks! Alan
<?xml version="1.0" encoding="UTF-8"?> <definitions name="TestService" targetNamespace="http://test.ibm.com/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://test.ibm.com/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"> <types> <xsd:schema> <xsd:import namespace="http://test.ibm.com/" schemaLocation="TestService_schema1.xsd"/> </xsd:schema> </types> <message name="echoResponse"> <part name="parameters" element="tns:echoResponse"> </part> </message> <message name="echo"> <part name="parameters" element="tns:echo"> </part> </message> <portType name="Test"> <operation name="echo"> <input message="tns:echo"> </input> <output message="tns:echoResponse"> </output> </operation> </portType> <binding name="TestPortBinding" type="tns:Test"> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> <operation name="echo"> <soap:operation soapAction=""/> <input> <soap:body use="literal"/> </input> <output> <soap:body use="literal"/> </output> </operation> </binding> <service name="TestService"> <port name="TestPort" binding="tns:TestPortBinding"> <soap:address location="http://localhost:9080/TestClient/TestService"/> </port> </service> </definitions>
