简体   繁体   中英

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

I am trying to build a web-app with the help of PHP and web services. I want to connect to the database using PHP's PDO through web services. I have built the server file, the client file and the wsdl file. With various tests I found that my wsdl file has some problems because when I run other functions with other wsdl files in my server and client files, they work proper. I and working on localhost and all the files are located in the wamp/www/myApp/api/ directory (Apache 2.2.8, PHP 5.2.6). I am posting the wsdl file for your reference. Please show me where I am getting wrong and do guide me to correct the errors. Thanks.

wsdl file:

    <?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>

Probably a PHP-error in the server-class or the class/function implementing the Login method. What happens when you access the file directly? And check your error log please.

I never wrote WSDL myself. Instead, you may write a mirror .NET Web Service and use the automatically generated WSDL (by MS Visual Studio).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM