Hi,

You can use servicemix-cxf-bc consumer to expose the webservice, which support imported schemas. The imported schemaLocation in the exposed wsdl file is changed to http url automatically for your client to access.

For example, in your local wsdl, you specify the xsd import as
<wsdl:types>
               <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
<xsd:import namespace="http://servicemix.apache.org/samples/wsdl-first/types"; schemaLocation="base.xsd"/>
               </xsd:schema>
 </wsdl:types>

then in the exposed wsdl from http, the schemaLocation is

<wsdl:types>
   <xsd:schema>
<xsd:import namespace="http://servicemix.apache.org/samples/wsdl-first/types"; schemaLocation="http://localhost:8092/PersonService/?xsd=base.xsd"/>
</xsd:schema>
</wsdl:types

Regards
Freeman

Ridire123 wrote:
I've run into a problem using the HTTP binding component.  I'm trying to use
an external client to invoke the service, which will clearly require
accessing the WSDL and the associated imported schemas.  Basically the
HTTP-BC just sits on top of an EIP endpoint, which just passes the message
on to do its thing.  The WSDL does get exposed, as I can go to
http://localhost:9876/blah/?wsdl and view the WSDL, however I cannot view
the schemas (and my client tells me it cannot find them) --
http://localhost:9876/blah/?xsd=common.xsd and essentially all similar URLs
just return a 404.

My xbean.xml for the HTTP BC looks something like this:

<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns:http="http://servicemix.apache.org/http/1.0";
       xmlns:blah="http://www.blah.com/blah";>

  <http:endpoint service="blah:BlahService"
                     endpoint="BlahEndpoint"
                     role="consumer"
                     locationURI="http://0.0.0.0:9876/blah/";
                     defaultMep="http://www.w3.org/2004/08/wsdl/in-out";
wsdlResource="file:/C:/apache-servicemix-3.2.2-SNAPSHOT/interfaces/blah/blah.wsdl"
                     soap="true"
                     soapVersion="1.1" />
                        
</beans>

And the import on the WSDL:

    <wsdl:types>
        <xsd:schema xmlns:ns="blah:test:this:thing"
            attributeFormDefault="qualified" elementFormDefault="qualified"
            targetNamespace="blah:test:this:thing">
             <xsd:include schemaLocation="blah-blah.xsd" />
        </xsd:schema>
    </wsdl:types>

The targetNamespace on the WSDL and the endpoint/service names all match up,
as does the binding address -- I have already checked this.  In fact, I can
invoke the service and successfully receive a response using a simple client
that does not require the WSDL (just sends in a preformatted message)

Also, as you can see, I'm using the 3.2.2 SNAPSHOT, which I thought had
fixed this problem with import statements.

Thanks for any help,
-Ridire123

Reply via email to