簡體   English   中英

肥皂提供未捕獲的SoapFault異常:[HTTP]訪存HTTP標頭時出錯

[英]soap giving Uncaught SoapFault exception: [HTTP] Error Fetching http headers

我正在嘗試借助PHP和Web服務構建一個Web應用程序。 我想通過Web服務使用PHP的PDO連接到數據庫。 我已經建立了服務器文件,客戶端文件和wsdl文件。 通過各種測試,我發現wsdl文件存在一些問題,因為當我在服務器和客戶端文件中對其他wsdl文件運行其他功能時,它們可以正常工作。 我正在localhost上工作,所有文件都位於wamp / www / myApp / api /目錄(Apache 2.2.8,PHP 5.2.6)中。 我正在發布wsdl文件供您參考。 請告訴我我哪里出問題了,並請指導我糾正錯誤。 謝謝。

wsdl文件:

    <?xml version="1.0" encoding="utf-8"?>
    <definitions name="MyService" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://My.Local.IP/myApp/api/my.wsdl" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2000/10/XMLSchema">

<message name="LoginRequest">
    <part name="dns" type="xsd:string"/>
    <part name="user" type="xsd:string"/>
    <part name="password" type="xsd:string"/>
</message>
<message name="LoginResponse">
    <part name="result" type="xsd:string"/>
</message>

<portType name="Fetch_PortType">
    <operation name="Login">
        <input message="tns:LoginRequest"/>
        <output message="tns:LoginResponse"/>
    </operation>
</portType>

<binding name="MyService_Binding" type="tns:Fetch_PortType">
    <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
    <operation name="Login">
        <soap:operation soapAction="http://My.Local.IP/myApp/api/Login"/>
        <input name="Login">
            <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded"/>
        </input>
        <output name="Login">
            <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded"/>
        </output>
    </operation>
</binding>

<service name="My_Service">
    <documentation>WSDL File MyService</documentation>
    <port name="Fetch_PortType" binding="tns:MyService_Binding">
        <soap:address location="http://My.Local.IP/myApp/api/server.php"/>
    </port>
</service>
    </definitions>

服務器類或實現Login方法的類/函數中可能出現PHP錯誤。 直接訪問文件會怎樣? 並請檢查您的錯誤日志。

我從來沒有親自寫過WSDL。 相反,您可以編寫一個鏡像.NET Web服務並使用自動生成的WSDL(由MS Visual Studio)。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM