Hi,

In data-services, we have a small issue, in finding out if we can
create a service with no targetNamespace for the result. That is, if
we can, not provide a targetNamespace in the types section in the
WSDL.

First, I simply tried it by not giving a targetNamespace to the
XMLSchema and, the types section were generated properly, but in the
"message" sections in the WSDL, the part element which reference a
schema type, it always outputs with the format "prefix:localName", so
since the targetNamespace is not available it prints as
"null:localName", thus it's invalid. I patched Axis2 and tried it
again, now it just prints as "localName".

So now if I deploy the data-service in question and code generate a
client using its WSDL (which has no targetNamespace in its types), the
client works fine, and you could get the service response properly.
But with the try-it tool it does not work properly, as in, it doesn't
return the result as it should. And by giving the WSDL to the
WSDLValidator, it states that the WSDL is invalid, giving a reason
related to having no targetNamespace. I've attached the WSDL in
question here, does anyone have an idea whether, this is actually a
valid WSDL, and if not giving a targetNamespace in the types is
possible? ..

Cheers,
Anjana.
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"; xmlns:axis2="http://ws.apache.org/axis2"; xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"; xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"; xmlns:xs="http://www.w3.org/2001/XMLSchema"; xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"; xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"; xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"; targetNamespace="http://ws.apache.org/axis2";>
    <wsdl:documentation/>
    <wsdl:types>
        <xs:schema attributeFormDefault="qualified" elementFormDefault="qualified">
            <xs:element name="employeesByNumber">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element minOccurs="0" name="employeeNumber" nillable="true" type="xs:int"/>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
            <xs:complexType name="employees">
                <xs:sequence>
                    <xs:element maxOccurs="unbounded" minOccurs="0" name="employee" nillable="true" type="employee"/>
                </xs:sequence>
            </xs:complexType>
            <xs:element name="employees" type="employees"/>
            <xs:complexType name="employee">
                <xs:sequence>
                    <xs:element name="last-name" nillable="true" type="xs:string"/>
                    <xs:element name="first-name" nillable="true" type="xs:string"/>
                    <xs:element name="email" nillable="true" type="xs:string"/>
                    <xs:element name="salary" nillable="true" type="xs:string"/>
                </xs:sequence>
            </xs:complexType>
            <xs:element name="setSalaryForEmployees">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element minOccurs="0" name="salary" nillable="true" type="xs:double"/>
                        <xs:element maxOccurs="unbounded" minOccurs="0" name="employeeNumbers" nillable="true" type="xs:int"/>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
            <xs:element name="customerAddress">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element minOccurs="0" name="lastName" nillable="true" type="xs:string"/>
                        <xs:element minOccurs="0" name="firstName" nillable="true" type="xs:string"/>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
            <xs:complexType name="customer-addresses">
                <xs:sequence>
                    <xs:element maxOccurs="unbounded" minOccurs="0" name="customer-address" nillable="true" type="customer-address"/>
                </xs:sequence>
            </xs:complexType>
            <xs:element name="customer-addresses" type="customer-addresses"/>
            <xs:complexType name="customer-address">
                <xs:sequence>
                    <xs:element name="customer-number" nillable="true" type="xs:string"/>
                    <xs:element name="contact-last-name" nillable="true" type="xs:string"/>
                    <xs:element name="contact-first-name" nillable="true" type="xs:string"/>
                    <xs:element name="address-line1" nillable="true" type="xs:string"/>
                    <xs:element name="address-line2" nillable="true" type="xs:string"/>
                    <xs:element name="city" nillable="true" type="xs:string"/>
                    <xs:element name="state" nillable="true" type="xs:string"/>
                    <xs:element name="postal-code" nillable="true" type="xs:string"/>
                    <xs:element name="country" nillable="true" type="xs:string"/>
                </xs:sequence>
            </xs:complexType>
            <xs:element name="setEmployeeSalary">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element minOccurs="0" name="salary" nillable="true" type="xs:double"/>
                        <xs:element minOccurs="0" name="employeeNumber" nillable="true" type="xs:int"/>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
            <xs:complexType name="Products">
                <xs:sequence>
                    <xs:element maxOccurs="unbounded" minOccurs="0" name="Product" nillable="true" type="Product"/>
                </xs:sequence>
            </xs:complexType>
            <xs:element name="Products" type="Products"/>
            <xs:complexType name="Product">
                <xs:sequence>
                    <xs:element name="productCode" nillable="true" type="xs:string"/>
                    <xs:element name="productName" nillable="true" type="xs:string"/>
                    <xs:element name="productLine" nillable="true" type="xs:string"/>
                    <xs:element name="productScale" nillable="true" type="xs:string"/>
                    <xs:element name="productVendor" nillable="true" type="xs:string"/>
                    <xs:element name="productDescription" nillable="true" type="xs:string"/>
                    <xs:element name="quantityInStock" nillable="true" type="xs:integer"/>
                    <xs:element name="buyPrice" nillable="true" type="xs:double"/>
                    <xs:element name="MSRP" nillable="true" type="xs:double"/>
                </xs:sequence>
            </xs:complexType>
            <xs:element name="addEmployee">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element minOccurs="0" name="employeeNumber" nillable="true" type="xs:int"/>
                        <xs:element minOccurs="0" name="lastName" nillable="true" type="xs:string"/>
                        <xs:element minOccurs="0" name="firstName" nillable="true" type="xs:string"/>
                        <xs:element minOccurs="0" name="email" nillable="true" type="xs:string"/>
                        <xs:element minOccurs="0" name="salary" nillable="true" type="xs:double"/>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
            <xs:complexType name="customers">
                <xs:sequence>
                    <xs:element maxOccurs="unbounded" minOccurs="0" name="customer" nillable="true" type="customer"/>
                </xs:sequence>
            </xs:complexType>
            <xs:element name="customers" type="customers"/>
            <xs:complexType name="customer">
                <xs:sequence>
                    <xs:element name="customer-name" nillable="true" type="xs:string"/>
                    <xs:element name="contact-last-name" nillable="true" type="xs:string"/>
                    <xs:element name="contact-first-name" nillable="true" type="xs:string"/>
                    <xs:element minOccurs="0" name="phone" nillable="true" type="xs:string"/>
                    <xs:element minOccurs="0" name="city" nillable="true" type="xs:string"/>
                    <xs:element minOccurs="0" name="country" nillable="true" type="xs:string"/>
                </xs:sequence>
            </xs:complexType>
            <xs:element name="incrementEmployeeSalary">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element minOccurs="0" name="increment" nillable="true" type="xs:double"/>
                        <xs:element minOccurs="0" name="employeeNumber" nillable="true" type="xs:int"/>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
        </xs:schema>
    </wsdl:types>
    <wsdl:message name="customerAddressRequest">
        <wsdl:part name="parameters" element="customerAddress"/>
    </wsdl:message>
    <wsdl:message name="customerAddressResponse">
        <wsdl:part name="parameters" element="customer-addresses"/>
    </wsdl:message>
    <wsdl:message name="abort_boxcarRequest"/>
    <wsdl:message name="incrementEmployeeSalaryRequest">
        <wsdl:part name="parameters" element="incrementEmployeeSalary"/>
    </wsdl:message>
    <wsdl:message name="addEmployeeRequest">
        <wsdl:part name="parameters" element="addEmployee"/>
    </wsdl:message>
    <wsdl:message name="begin_boxcarRequest"/>
    <wsdl:message name="end_boxcarRequest"/>
    <wsdl:message name="setSalaryForEmployeesRequest">
        <wsdl:part name="parameters" element="setSalaryForEmployees"/>
    </wsdl:message>
    <wsdl:message name="employeesByNumberRequest">
        <wsdl:part name="parameters" element="employeesByNumber"/>
    </wsdl:message>
    <wsdl:message name="employeesByNumberResponse">
        <wsdl:part name="parameters" element="employees"/>
    </wsdl:message>
    <wsdl:message name="productsInfoRequest"/>
    <wsdl:message name="productsInfoResponse">
        <wsdl:part name="parameters" element="Products"/>
    </wsdl:message>
    <wsdl:message name="customersInBostonRequest"/>
    <wsdl:message name="customersInBostonResponse">
        <wsdl:part name="parameters" element="customers"/>
    </wsdl:message>
    <wsdl:message name="setEmployeeSalaryRequest">
        <wsdl:part name="parameters" element="setEmployeeSalary"/>
    </wsdl:message>
    <wsdl:portType name="DataServiceSample1PortType">
        <wsdl:operation name="customerAddress">
            <wsdl:input message="axis2:customerAddressRequest" wsaw:Action="urn:customerAddress"/>
            <wsdl:output message="axis2:customerAddressResponse" wsaw:Action="urn:customerAddressResponse"/>
        </wsdl:operation>
        <wsdl:operation name="abort_boxcar">
            <wsdl:input message="axis2:abort_boxcarRequest" wsaw:Action="urn:abort_boxcar"/>
        </wsdl:operation>
        <wsdl:operation name="incrementEmployeeSalary">
            <wsdl:input message="axis2:incrementEmployeeSalaryRequest" wsaw:Action="urn:incrementEmployeeSalary"/>
        </wsdl:operation>
        <wsdl:operation name="addEmployee">
            <wsdl:input message="axis2:addEmployeeRequest" wsaw:Action="urn:addEmployee"/>
        </wsdl:operation>
        <wsdl:operation name="begin_boxcar">
            <wsdl:input message="axis2:begin_boxcarRequest" wsaw:Action="urn:begin_boxcar"/>
        </wsdl:operation>
        <wsdl:operation name="end_boxcar">
            <wsdl:input message="axis2:end_boxcarRequest" wsaw:Action="urn:end_boxcar"/>
        </wsdl:operation>
        <wsdl:operation name="setSalaryForEmployees">
            <wsdl:input message="axis2:setSalaryForEmployeesRequest" wsaw:Action="urn:setSalaryForEmployees"/>
        </wsdl:operation>
        <wsdl:operation name="employeesByNumber">
            <wsdl:input message="axis2:employeesByNumberRequest" wsaw:Action="urn:employeesByNumber"/>
            <wsdl:output message="axis2:employeesByNumberResponse" wsaw:Action="urn:employeesByNumberResponse"/>
        </wsdl:operation>
        <wsdl:operation name="productsInfo">
            <wsdl:input message="axis2:productsInfoRequest" wsaw:Action="urn:productsInfo"/>
            <wsdl:output message="axis2:productsInfoResponse" wsaw:Action="urn:productsInfoResponse"/>
        </wsdl:operation>
        <wsdl:operation name="customersInBoston">
            <wsdl:input message="axis2:customersInBostonRequest" wsaw:Action="urn:customersInBoston"/>
            <wsdl:output message="axis2:customersInBostonResponse" wsaw:Action="urn:customersInBostonResponse"/>
        </wsdl:operation>
        <wsdl:operation name="setEmployeeSalary">
            <wsdl:input message="axis2:setEmployeeSalaryRequest" wsaw:Action="urn:setEmployeeSalary"/>
        </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="DataServiceSample1SOAP11Binding" type="axis2:DataServiceSample1PortType">
        <soap:binding transport="http://schemas.xmlsoap.org/soap/http"; style="document"/>
        <wsdl:operation name="customerAddress">
            <soap:operation soapAction="urn:customerAddress" style="document"/>
            <wsdl:input>
                <soap:body use="literal"/>
            </wsdl:input>
            <wsdl:output>
                <soap:body use="literal"/>
            </wsdl:output>
        </wsdl:operation>
        <wsdl:operation name="abort_boxcar">
            <soap:operation soapAction="urn:abort_boxcar" style="document"/>
            <wsdl:input>
                <soap:body use="literal"/>
            </wsdl:input>
        </wsdl:operation>
        <wsdl:operation name="incrementEmployeeSalary">
            <soap:operation soapAction="urn:incrementEmployeeSalary" style="document"/>
            <wsdl:input>
                <soap:body use="literal"/>
            </wsdl:input>
        </wsdl:operation>
        <wsdl:operation name="addEmployee">
            <soap:operation soapAction="urn:addEmployee" style="document"/>
            <wsdl:input>
                <soap:body use="literal"/>
            </wsdl:input>
        </wsdl:operation>
        <wsdl:operation name="begin_boxcar">
            <soap:operation soapAction="urn:begin_boxcar" style="document"/>
            <wsdl:input>
                <soap:body use="literal"/>
            </wsdl:input>
        </wsdl:operation>
        <wsdl:operation name="end_boxcar">
            <soap:operation soapAction="urn:end_boxcar" style="document"/>
            <wsdl:input>
                <soap:body use="literal"/>
            </wsdl:input>
        </wsdl:operation>
        <wsdl:operation name="setSalaryForEmployees">
            <soap:operation soapAction="urn:setSalaryForEmployees" style="document"/>
            <wsdl:input>
                <soap:body use="literal"/>
            </wsdl:input>
        </wsdl:operation>
        <wsdl:operation name="employeesByNumber">
            <soap:operation soapAction="urn:employeesByNumber" style="document"/>
            <wsdl:input>
                <soap:body use="literal"/>
            </wsdl:input>
            <wsdl:output>
                <soap:body use="literal"/>
            </wsdl:output>
        </wsdl:operation>
        <wsdl:operation name="productsInfo">
            <soap:operation soapAction="urn:productsInfo" style="document"/>
            <wsdl:input>
                <soap:body use="literal"/>
            </wsdl:input>
            <wsdl:output>
                <soap:body use="literal"/>
            </wsdl:output>
        </wsdl:operation>
        <wsdl:operation name="customersInBoston">
            <soap:operation soapAction="urn:customersInBoston" style="document"/>
            <wsdl:input>
                <soap:body use="literal"/>
            </wsdl:input>
            <wsdl:output>
                <soap:body use="literal"/>
            </wsdl:output>
        </wsdl:operation>
        <wsdl:operation name="setEmployeeSalary">
            <soap:operation soapAction="urn:setEmployeeSalary" style="document"/>
            <wsdl:input>
                <soap:body use="literal"/>
            </wsdl:input>
        </wsdl:operation>
    </wsdl:binding>
    <wsdl:binding name="DataServiceSample1SOAP12Binding" type="axis2:DataServiceSample1PortType">
        <soap12:binding transport="http://schemas.xmlsoap.org/soap/http"; style="document"/>
        <wsdl:operation name="customerAddress">
            <soap12:operation soapAction="urn:customerAddress" style="document"/>
            <wsdl:input>
                <soap12:body use="literal"/>
            </wsdl:input>
            <wsdl:output>
                <soap12:body use="literal"/>
            </wsdl:output>
        </wsdl:operation>
        <wsdl:operation name="abort_boxcar">
            <soap12:operation soapAction="urn:abort_boxcar" style="document"/>
            <wsdl:input>
                <soap12:body use="literal"/>
            </wsdl:input>
        </wsdl:operation>
        <wsdl:operation name="incrementEmployeeSalary">
            <soap12:operation soapAction="urn:incrementEmployeeSalary" style="document"/>
            <wsdl:input>
                <soap12:body use="literal"/>
            </wsdl:input>
        </wsdl:operation>
        <wsdl:operation name="addEmployee">
            <soap12:operation soapAction="urn:addEmployee" style="document"/>
            <wsdl:input>
                <soap12:body use="literal"/>
            </wsdl:input>
        </wsdl:operation>
        <wsdl:operation name="begin_boxcar">
            <soap12:operation soapAction="urn:begin_boxcar" style="document"/>
            <wsdl:input>
                <soap12:body use="literal"/>
            </wsdl:input>
        </wsdl:operation>
        <wsdl:operation name="end_boxcar">
            <soap12:operation soapAction="urn:end_boxcar" style="document"/>
            <wsdl:input>
                <soap12:body use="literal"/>
            </wsdl:input>
        </wsdl:operation>
        <wsdl:operation name="setSalaryForEmployees">
            <soap12:operation soapAction="urn:setSalaryForEmployees" style="document"/>
            <wsdl:input>
                <soap12:body use="literal"/>
            </wsdl:input>
        </wsdl:operation>
        <wsdl:operation name="employeesByNumber">
            <soap12:operation soapAction="urn:employeesByNumber" style="document"/>
            <wsdl:input>
                <soap12:body use="literal"/>
            </wsdl:input>
            <wsdl:output>
                <soap12:body use="literal"/>
            </wsdl:output>
        </wsdl:operation>
        <wsdl:operation name="productsInfo">
            <soap12:operation soapAction="urn:productsInfo" style="document"/>
            <wsdl:input>
                <soap12:body use="literal"/>
            </wsdl:input>
            <wsdl:output>
                <soap12:body use="literal"/>
            </wsdl:output>
        </wsdl:operation>
        <wsdl:operation name="customersInBoston">
            <soap12:operation soapAction="urn:customersInBoston" style="document"/>
            <wsdl:input>
                <soap12:body use="literal"/>
            </wsdl:input>
            <wsdl:output>
                <soap12:body use="literal"/>
            </wsdl:output>
        </wsdl:operation>
        <wsdl:operation name="setEmployeeSalary">
            <soap12:operation soapAction="urn:setEmployeeSalary" style="document"/>
            <wsdl:input>
                <soap12:body use="literal"/>
            </wsdl:input>
        </wsdl:operation>
    </wsdl:binding>
    <wsdl:binding name="DataServiceSample1HttpBinding" type="axis2:DataServiceSample1PortType">
        <http:binding verb="POST"/>
        <wsdl:operation name="customerAddress">
            <http:operation location="customerAddress"/>
            <wsdl:input>
                <mime:content type="text/xml" part="customerAddress"/>
            </wsdl:input>
            <wsdl:output>
                <mime:content type="text/xml" part="customerAddress"/>
            </wsdl:output>
        </wsdl:operation>
        <wsdl:operation name="abort_boxcar">
            <http:operation location="abort_boxcar"/>
            <wsdl:input>
                <mime:content type="text/xml" part="abort_boxcar"/>
            </wsdl:input>
        </wsdl:operation>
        <wsdl:operation name="incrementEmployeeSalary">
            <http:operation location="incrementEmployeeSalary"/>
            <wsdl:input>
                <mime:content type="text/xml" part="incrementEmployeeSalary"/>
            </wsdl:input>
        </wsdl:operation>
        <wsdl:operation name="addEmployee">
            <http:operation location="addEmployee"/>
            <wsdl:input>
                <mime:content type="text/xml" part="addEmployee"/>
            </wsdl:input>
        </wsdl:operation>
        <wsdl:operation name="begin_boxcar">
            <http:operation location="begin_boxcar"/>
            <wsdl:input>
                <mime:content type="text/xml" part="begin_boxcar"/>
            </wsdl:input>
        </wsdl:operation>
        <wsdl:operation name="end_boxcar">
            <http:operation location="end_boxcar"/>
            <wsdl:input>
                <mime:content type="text/xml" part="end_boxcar"/>
            </wsdl:input>
        </wsdl:operation>
        <wsdl:operation name="setSalaryForEmployees">
            <http:operation location="setSalaryForEmployees"/>
            <wsdl:input>
                <mime:content type="text/xml" part="setSalaryForEmployees"/>
            </wsdl:input>
        </wsdl:operation>
        <wsdl:operation name="employeesByNumber">
            <http:operation location="employeesByNumber"/>
            <wsdl:input>
                <mime:content type="text/xml" part="employeesByNumber"/>
            </wsdl:input>
            <wsdl:output>
                <mime:content type="text/xml" part="employeesByNumber"/>
            </wsdl:output>
        </wsdl:operation>
        <wsdl:operation name="productsInfo">
            <http:operation location="productsInfo"/>
            <wsdl:input>
                <mime:content type="text/xml" part="productsInfo"/>
            </wsdl:input>
            <wsdl:output>
                <mime:content type="text/xml" part="productsInfo"/>
            </wsdl:output>
        </wsdl:operation>
        <wsdl:operation name="customersInBoston">
            <http:operation location="customersInBoston"/>
            <wsdl:input>
                <mime:content type="text/xml" part="customersInBoston"/>
            </wsdl:input>
            <wsdl:output>
                <mime:content type="text/xml" part="customersInBoston"/>
            </wsdl:output>
        </wsdl:operation>
        <wsdl:operation name="setEmployeeSalary">
            <http:operation location="setEmployeeSalary"/>
            <wsdl:input>
                <mime:content type="text/xml" part="setEmployeeSalary"/>
            </wsdl:input>
        </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="DataServiceSample1">
        <wsdl:port name="SOAP11Endpoint" binding="axis2:DataServiceSample1SOAP11Binding">
            <soap:address location="http://192.168.2.132:9763/services/DataServiceSample1.SOAP11Endpoint/"/>
        </wsdl:port>
        <wsdl:port name="SecureSOAP11Endpoint" binding="axis2:DataServiceSample1SOAP11Binding">
            <soap:address location="https://192.168.2.132:9443/services/DataServiceSample1.SecureSOAP11Endpoint/"/>
        </wsdl:port>
        <wsdl:port name="SecureSOAP12Endpoint" binding="axis2:DataServiceSample1SOAP12Binding">
            <soap12:address location="https://192.168.2.132:9443/services/DataServiceSample1.SecureSOAP12Endpoint/"/>
        </wsdl:port>
        <wsdl:port name="SOAP12Endpoint" binding="axis2:DataServiceSample1SOAP12Binding">
            <soap12:address location="http://192.168.2.132:9763/services/DataServiceSample1.SOAP12Endpoint/"/>
        </wsdl:port>
        <wsdl:port name="HTTPEndpoint" binding="axis2:DataServiceSample1HttpBinding">
            <http:address location="http://192.168.2.132:9763/services/DataServiceSample1.HTTPEndpoint/"/>
        </wsdl:port>
        <wsdl:port name="SecureHTTPEndpoint" binding="axis2:DataServiceSample1HttpBinding">
            <http:address location="https://192.168.2.132:9443/services/DataServiceSample1.SecureHTTPEndpoint/"/>
        </wsdl:port>
    </wsdl:service>
</wsdl:definitions>
_______________________________________________
Carbon-dev mailing list
Carbon-dev@wso2.org
https://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev

Reply via email to