简体   繁体   中英

PHP/SOAP - How to create working request with SOAP

Here is my request in SoapUI:

在此处输入图片说明

With SoapUI i send the request and i receive good response.

Here is my PHP code so far:

<?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();
    }

When i execute the code i receive:

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

Somehow i'm doing something wrong. I'm not really sure if i made my PHP request correct.

Where is my mistake, and how the correct request should look like ?

With an SoapClient error like "Premature end of data in tag html" your link to the WSDL file is usually not correct.

Try this one: https://onlinefatura.xyz/foyws/FoyOnlineApiGateWS.asmx?WSDL

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