SOAPUI无法显示wsdl中包含的函数名称

时间:2013-11-18 04:55:50

标签: web-services soap wsdl soapui

我使用zend framework

创建了一个wsdl,如下所示
<?xml version="1.0"?>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/"     xmlns:tns="http://soap.loc/index/soap" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" name="Example_Manager" targetNamespace="http://soap.loc/index/soap">
<types>
    <xsd:schema targetNamespace="http://soap.loc/index/soap">
        <xsd:element name="getProducts">
            <xsd:complexType/>
        </xsd:element>
        <xsd:element name="getProductsResponse">
            <xsd:complexType>
                <xsd:sequence>
                    <xsd:element name="getProductsResult" type="soap-enc:Array"/>
                </xsd:sequence>
            </xsd:complexType>
        </xsd:element>
        <xsd:element name="getProduct">
            <xsd:complexType>
                <xsd:sequence>
                    <xsd:element name="id" type="xsd:int"/>
                </xsd:sequence>
            </xsd:complexType>
        </xsd:element>
        <xsd:element name="getProductResponse">
            <xsd:complexType>
                <xsd:sequence>
                    <xsd:element name="getProductResult" type="soap-enc:Array"/>
                </xsd:sequence>
            </xsd:complexType>
        </xsd:element>
        <xsd:element name="addProduct">
            <xsd:complexType>
                <xsd:sequence>
                    <xsd:element name="data" type="soap-enc:Array"/>
                </xsd:sequence>
            </xsd:complexType>
        </xsd:element>
        <xsd:element name="addProductResponse">
            <xsd:complexType>
                <xsd:sequence>
                    <xsd:element name="addProductResult" type="xsd:int"/>
                </xsd:sequence>
            </xsd:complexType>
        </xsd:element>
        <xsd:element name="deleteProduct">
            <xsd:complexType>
                <xsd:sequence>
                    <xsd:element name="id" type="xsd:int"/>
                </xsd:sequence>
            </xsd:complexType>
        </xsd:element>
        <xsd:element name="deleteProductResponse">
            <xsd:complexType>
                <xsd:sequence>
                    <xsd:element name="deleteProductResult" type="xsd:int"/>
                </xsd:sequence>
            </xsd:complexType>
        </xsd:element>
        <xsd:element name="updateProduct">
            <xsd:complexType>
                <xsd:sequence>
                    <xsd:element name="id" type="xsd:int"/>
                    <xsd:element name="data" type="soap-enc:Array"/>
                </xsd:sequence>
            </xsd:complexType>
        </xsd:element>
        <xsd:element name="updateProductResponse">
            <xsd:complexType>
                <xsd:sequence>
                    <xsd:element name="updateProductResult" type="xsd:int"/>
                </xsd:sequence>
            </xsd:complexType>
        </xsd:element>
    </xsd:schema>
</types>
<portType name="Example_ManagerPort">
    <operation name="getProducts">
        <documentation>Returns list of all products in database</documentation>
        <input message="tns:getProductsIn"/>
        <output message="tns:getProductsOut"/>
    </operation>
    <operation name="getProduct">
        <documentation>Returns specified product in database</documentation>
        <input message="tns:getProductIn"/>
        <output message="tns:getProductOut"/>
    </operation>
    <operation name="addProduct">
        <documentation>Adds new product to database</documentation>
        <input message="tns:addProductIn"/>
        <output message="tns:addProductOut"/>
    </operation>
    <operation name="deleteProduct">
        <documentation>Deletes product from database</documentation>
        <input message="tns:deleteProductIn"/>
        <output message="tns:deleteProductOut"/>
    </operation>
    <operation name="updateProduct">
        <documentation>Updates product in database</documentation>
        <input message="tns:updateProductIn"/>
        <output message="tns:updateProductOut"/>
    </operation>
</portType>
<binding name="Example_ManagerBinding" type="tns:Example_ManagerPort">
    <soap:binding style="document" transport="http://framework.zend.com"/>
    <operation name="getProducts">
        <soap:operation soapAction="http://soap.loc/index/soap#getProducts"/>
        <input>
            <soap:body use="literal" namespace="http://framework.zend.com"/>
        </input>
        <output>
            <soap:body use="literal" namespace="http://framework.zend.com"/>
        </output>
    </operation>
    <operation name="getProduct">
        <soap:operation soapAction="http://soap.loc/index/soap#getProduct"/>
        <input>
            <soap:body use="literal" namespace="http://framework.zend.com"/>
        </input>
        <output>
            <soap:body use="literal" namespace="http://framework.zend.com"/>
        </output>
    </operation>
    <operation name="addProduct">
        <soap:operation soapAction="http://soap.loc/index/soap#addProduct"/>
        <input>
            <soap:body use="literal" namespace="http://framework.zend.com"/>
        </input>
        <output>
            <soap:body use="literal" namespace="http://framework.zend.com"/>
        </output>
    </operation>
    <operation name="deleteProduct">
        <soap:operation soapAction="http://soap.loc/index/soap#deleteProduct"/>
        <input>
            <soap:body use="literal" namespace="http://framework.zend.com"/>
        </input>
        <output>
            <soap:body use="literal" namespace="http://framework.zend.com"/>
        </output>
    </operation>
    <operation name="updateProduct">
        <soap:operation soapAction="http://soap.loc/index/soap#updateProduct"/>
        <input>
            <soap:body use="literal" namespace="http://framework.zend.com"/>
        </input>
        <output>
            <soap:body use="literal" namespace="http://framework.zend.com"/>
        </output>
    </operation>
</binding>
<service name="Example_ManagerService">
    <port name="Example_ManagerPort" binding="tns:Example_ManagerBinding">
        <soap:address location="http://soap.loc/index/soap"/>
    </port>
</service>
<message name="getProductsIn">
    <part name="parameters" element="tns:getProducts"/>
</message>
<message name="getProductsOut">
    <part name="parameters" element="tns:getProductsResponse"/>
</message>
<message name="getProductIn">
    <part name="parameters" element="tns:getProduct"/>
</message>
<message name="getProductOut">
    <part name="parameters" element="tns:getProductResponse"/>
</message>
<message name="addProductIn">
    <part name="parameters" element="tns:addProduct"/>
</message>
<message name="addProductOut">
    <part name="parameters" element="tns:addProductResponse"/>
</message>
<message name="deleteProductIn">
    <part name="parameters" element="tns:deleteProduct"/>
</message>
<message name="deleteProductOut">
    <part name="parameters" element="tns:deleteProductResponse"/>
</message>
<message name="updateProductIn">
    <part name="parameters" element="tns:updateProduct"/>
</message>
<message name="updateProductOut">
    <part name="parameters" element="tns:updateProductResponse"/>
</message>

现在的问题是,当我在soapui中加载它时,函数名称没有显示。 之前我有一个使用NuSoap工作的wsdl,它生成了wsdl并且可以加载到SOAPUi中并显示函数名称。

新的Web服务业务,很高兴知道它是否与wsdl本身有关。

在显示器上敲我的头以获得答案.......但我看到的只有星星。

1 个答案:

答案 0 :(得分:0)

先生,你错过了wsdl中的标签。这不对。 以xml的形式保存您的wsdl,如果您将在Web浏览器中打开它,您将发现错误。