PHP/SOAP - 如何使用 SOAP 创建工作请求

维内林

这是我在 SoapUI 中的请求:

在此处输入图片说明

使用 SoapUI,我发送请求并收到良好的响应。

到目前为止,这是我的 PHP 代码:

<?PHP
    $wsdl = 'https://onlinefatura.xyz/foyws/FoyOnlineApiGateWS.asmx';


    try{
        $clinet=new SoapClient($wsdl);

        $ver =array(
            "UserName"=>"USERNAME",
            "Password"=>"PASSWORD",
            "ApiKey"=>"APIKEYHERE",
            "Date"=>"2017-11-09",
        );
        $quates=$clinet->GetAddedBalanceList($ver);

        var_dump($quates);


    }

    catch(SoapFault $e)
    {
        echo $e->getMessage();
    }

当我执行代码时,我收到:

SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://onlinefatura.xyz/foyws/FoyOnlineApiGateWS.asmx' : Premature end of data in tag html line 3

不知何故,我做错了什么。我不确定我的 PHP 请求是否正确。

我的错误在哪里,正确的请求应该是什么样的?

赞德

对于“标记 html 中的数据过早结束”之类的 SoapClient 错误,您到 WSDL 文件的链接通常不正确。

试试这个:https : //onlinefatura.xyz/foyws/FoyOnlineApiGateWS.asmx?WSDL

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章