服务已运行,但zeeps返回“服务未运行”

时间:2019-08-22 09:55:22

标签: php python xsd wsdl

我正在尝试编写自己的WSDL,它几乎完成了,但是当我尝试从python调用函数时,它返回Service没有任何操作。

我在线检查了WSDL的更正,语法很好。

Python部分

    from zeep import Client

client = Client('http://localhost/objednani/www/soap/ObjednaniKLekariService.wsdl')
result = client.service.getPatientInfo(40)
print(result)

Web服务的WSDL

<?xml version="1.0" encoding="UTF-8"?>
<definitions name="ObjednaniKLekariService"
    xmlns="http://schemas.xmlsoap.org/wsdl/"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns:tns="http://localhost/objednani/www/soap/ObjednaniKLekariService.wsdl"
    targetNamespace="http://localhost/objednani/www/soap/ObjednaniKLekariService.wsdl"
    xmlns:xsd1 = "http://localhost/objednani/www/soap/ObjednaniKLekariService.xsd">
    <types>
        <schemas targetNamespace="http://localhost/objednani/www/soap/ObjednaniKLekariService.xsd"
            xmlns = "http://www.w3.org/2001/XMLSchema">
            <element name = "PatientInfo">
                <complexType>
                    <sequence>
                        <element name="name" type="string" />
                        <element name="surname" type="string" />
                        <element name="birthDate" type="date" />
                        <element name="email" type="string" />
                        <element name="phoneNumber" type="int" />
                        <element name="visitDateTime" type="dateTime" />
                    </sequence>
                </complexType>
            </element>
            <element name="PatientInfoArray">
                <complexType>
                    <sequence>
                        <element minOccurs="0" maxOccurs="unbounded" name="patientName" type="PatientInfo" />
                    </sequence>
                </complexType>
            </element>
        </schemas>
    </types>
    <message name="getPatientInfoRequest">
        <part name="body" element="xsd1:PatientInfo" />
    </message>
    <message name="getPatientInfoResponse">
        <part name="body" element="xsd1:PatientInfoArray" />
    </message>
    <portType name="getPatientInfo_PortType">
        <operation name="getPatientInfo">
            <input message="tns:getPatientInfoRequest" />
            <output message="tns:getPatientInfoResponse" />
        </operation>
    </portType>
    <binding name="getPatientInfo_Binding" type="tns:getPatientInfo_PortType">
        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
        <operation name="getPatientInfo">
            <soap:operation soapAction="http://localhost/objednani/www/soap/getPatientInfo" />
            <input>
                <soap:body use="literal" />
            </input>
            <output>
                <soap:body use="literal" />
            </output>
        </operation>
    </binding>
    <service name="ObjednaniKLekari_Service">
        <documentation>WSDL File for ObjednaniKLekari</documentation>
        <port binding="tns:getPatientInfo_Binding" name="getPatientInfo_Port">
            <soap:address location="http://localhost/objednani/www/soap/server.php" />
        </port>
    </service>
</definitions>

我希望结果是php中的函数调用

0 个答案:

没有答案