Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/257.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php soap提供未捕获的SoapFault异常:[HTTP]获取HTTP头时出错_Php_Soap_Wsdl - Fatal编程技术网

Php soap提供未捕获的SoapFault异常:[HTTP]获取HTTP头时出错

Php soap提供未捕获的SoapFault异常:[HTTP]获取HTTP头时出错,php,soap,wsdl,Php,Soap,Wsdl,我正试图在PHP和web服务的帮助下构建一个web应用程序。我想通过web服务使用PHP的PDO连接到数据库。我已经构建了服务器文件、客户机文件和wsdl文件。通过各种测试,我发现我的wsdl文件存在一些问题,因为当我使用服务器和客户机文件中的其他wsdl文件运行其他函数时,它们工作正常。我在localhost上工作,所有文件都位于wamp/www/myApp/api/目录apache2.2.8,php5.2.6中。我正在发布wsdl文件供您参考。请告诉我哪里出错,并指导我改正错误。谢谢 wsd

我正试图在PHP和web服务的帮助下构建一个web应用程序。我想通过web服务使用PHP的PDO连接到数据库。我已经构建了服务器文件、客户机文件和wsdl文件。通过各种测试,我发现我的wsdl文件存在一些问题,因为当我使用服务器和客户机文件中的其他wsdl文件运行其他函数时,它们工作正常。我在localhost上工作,所有文件都位于wamp/www/myApp/api/目录apache2.2.8,php5.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>

可能是服务器类或实现登录方法的类/函数中的PHP错误。
直接访问文件时会发生什么情况?请检查您的错误日志。

我自己从来没有写过WSDL。相反,您可以编写一个镜像.NET Web服务并使用MS Visual Studio自动生成的WSDL。

@Louis..登录方法很好。函数Login$dsn,$user,$password{try{$dbh=new PDO$dsn,$user,$password;}捕获PDO异常$e{return$result=$e->getMessage;}}。wsdl中的SoapAction是否正常?