Support for Flatten or In-lined serving WSDL
--------------------------------------------

                 Key: CXF-2776
                 URL: https://issues.apache.org/jira/browse/CXF-2776
             Project: CXF
          Issue Type: New Feature
    Affects Versions: 2.2.7, 2.3, 2.2.8
         Environment: Any
            Reporter: Tejash Shah
             Fix For: 2.3, 2.2.8


We are looking for option using which serving WSDL can shown as in-lined or 
flatten. e.g

I have schema as follows:

customer.xsd
------------------
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"; 
targetNamespace="http://www.example.org/customer";
        xmlns:tns="http://www.example.org/customer"; 
elementFormDefault="qualified">

    <complexType name="customer">
        <sequence>
                <element name="name" type="string"></element>
                <element name="id" type="string"></element>
                <element name="contact" type="string"></element>
        </sequence>
    </complexType>
</schema>
-------------------
And the WSDL content is as follows:
-------------------
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
        xmlns:tns="urn:CustomerService/" 
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
        xmlns:xsd="http://www.w3.org/2001/XMLSchema"; name="CustomerService"
        targetNamespace="urn:CustomerService/">
        <wsdl:types>
                <xsd:schema targetNamespace="urn:CustomerService/"
                        xmlns:pref="http://www.example.org/customer";>
                        <xsd:import schemaLocation="customer.xsd"
                                
namespace="http://www.example.org/customer";></xsd:import>

                        <xsd:element name="addCustomerReqEl" 
type="pref:customer"></xsd:element>

                        <xsd:element name="addCustomerRespEl" 
type="tns:CustomerRespType">
                        </xsd:element>

                        <xsd:complexType name="CustomerRespType">
                                <xsd:sequence>
                                        <xsd:element name="customer" 
type="pref:customer"></xsd:element>
                                        <xsd:element name="status" 
type="xsd:string"></xsd:element>
                                </xsd:sequence>
                        </xsd:complexType>
                </xsd:schema>
        </wsdl:types>
        <wsdl:message name="addCustomerRequest">
                <wsdl:part element="tns:addCustomerReqEl" name="parameters" />
        </wsdl:message>
        <wsdl:message name="addCustomerResponse">
                <wsdl:part element="tns:addCustomerRespEl" name="parameters" />
        </wsdl:message>
        <wsdl:portType name="CustomerService">
                <wsdl:operation name="addCustomer">
                        <wsdl:input message="tns:addCustomerRequest" />
                        <wsdl:output message="tns:addCustomerResponse" />
                </wsdl:operation>
        </wsdl:portType>
        <wsdl:binding name="CustomerServiceSOAP" type="tns:CustomerService">
                <soap:binding style="document"
                        transport="http://schemas.xmlsoap.org/soap/http"; />
                <wsdl:operation name="addCustomer">
                        <soap:operation 
soapAction="urn:CustomerService/addCustomer" />
                        <wsdl:input>
                                <soap:body use="literal" />
                        </wsdl:input>
                        <wsdl:output>
                                <soap:body use="literal" />
                        </wsdl:output>
                </wsdl:operation>
        </wsdl:binding>
        <wsdl:service name="CustomerService">
                <wsdl:port binding="tns:CustomerServiceSOAP" 
name="CustomerServiceSOAP">
                        <soap:address 
location="http://localhost:8080/CustomerService"; />
                </wsdl:port>
        </wsdl:service>
</wsdl:definitions>
---------------------------------

When I deploy this WSDL using spring, camel and CXF as web-service, the serving 
WSDL (http://localhost:8080/CustomerService?WSDL) content shows schema location 
as http location (http://localhost:8080/CustomerService?xsd=customer.xsd)

--------------------------------

My Requirement:
- I want the imported schema content to be in-lined / flatten inside WSDL.
- If imported schema internally imports/ includes another schema that also need 
to be in-lined 
- Also in-lined WSDL will show all included schema as merged in to single 
schema section to avoid conflicts.


For the above WSDL when it gets served we may have parameter to the URL e.g. 
http://localhost:8080/CustomerService?WSDL&flat=1 and it should give me flat 
WSDL as follows:
-------------------

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
        xmlns:tns="urn:CustomerService/" 
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
        xmlns:xsd="http://www.w3.org/2001/XMLSchema"; name="CustomerService"
        targetNamespace="urn:CustomerService/">
        <wsdl:types>
                <xsd:schema targetNamespace="urn:CustomerService/"
                        xmlns:pref="http://www.example.org/customer";>
                        <xsd:import 
namespace="http://www.example.org/customer";></xsd:import>

                        <xsd:element name="addCustomerReqEl" 
type="pref:customer"></xsd:element>

                        <xsd:element name="addCustomerRespEl" 
type="tns:CustomerRespType">
                        </xsd:element>

                        <xsd:complexType name="CustomerRespType">
                                <xsd:sequence>
                                        <xsd:element name="customer" 
type="pref:customer"></xsd:element>
                                        <xsd:element name="status" 
type="xsd:string"></xsd:element>
                                </xsd:sequence>
                        </xsd:complexType>
                </xsd:schema>
                <!-- Here the content of Customer.xsd is in-lined / flatten -->
                <xsd:schema xmlns="http://www.w3.org/2001/XMLSchema";
                        targetNamespace="http://www.example.org/customer"; 
xmlns:tns="http://www.example.org/customer";
                        elementFormDefault="qualified">

                        <complexType name="customer">
                                <sequence>
                                        <element name="name" 
type="string"></element>
                                        <element name="id" 
type="string"></element>
                                        <element name="contact" 
type="string"></element>
                                </sequence>
                        </complexType>
                </xsd:schema>
        </wsdl:types>
        <wsdl:message name="addCustomerRequest">
                <wsdl:part element="tns:addCustomerReqEl" name="parameters" />
        </wsdl:message>
        <wsdl:message name="addCustomerResponse">
                <wsdl:part element="tns:addCustomerRespEl" name="parameters" />
        </wsdl:message>
        <wsdl:portType name="CustomerService">
                <wsdl:operation name="addCustomer">
                        <wsdl:input message="tns:addCustomerRequest" />
                        <wsdl:output message="tns:addCustomerResponse" />
                </wsdl:operation>
        </wsdl:portType>
        <wsdl:binding name="CustomerServiceSOAP" type="tns:CustomerService">
                <soap:binding style="document"
                        transport="http://schemas.xmlsoap.org/soap/http"; />
                <wsdl:operation name="addCustomer">
                        <soap:operation 
soapAction="urn:CustomerService/addCustomer" />
                        <wsdl:input>
                                <soap:body use="literal" />
                        </wsdl:input>
                        <wsdl:output>
                                <soap:body use="literal" />
                        </wsdl:output>
                </wsdl:operation>
        </wsdl:binding>
        <wsdl:service name="CustomerService">
                <wsdl:port binding="tns:CustomerServiceSOAP" 
name="CustomerServiceSOAP">
                        <soap:address location="http://www.example.org/"; />
                </wsdl:port>
        </wsdl:service>
</wsdl:definitions>






-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to