WSDL reading shows strange first character with php

236 views Asked by At

I'm reading a wsdl for SOAP connection :
https://api3.popfax.com/index.php?service=Popfax&wsdl

Other clients (mobile apps, desktop software, ...) are using it and have been doing so for a long time.

When I try to construct a SoapClient from it, I get :
Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://api3.popfax.com/index.php?service=Popfax&wsdl' : Start tag expected, '<' not found in D:\Dev\test\sendfax.php:32 Stack trace: #0 D:\Dev\test\sendfax.php(32): SoapClient->SoapClient('https://api3.po...') #1 {main} thrown in D:\Dev\test\sendfax.php on line 32

So I wrote this to test what I got :

$wsdl = 'https://api3.popfax.com/index.php?service=Popfax&wsdl';
$bip = file_get_contents($wsdl);
var_dump($bip);

And the result is string with on the first line :
'ï<?xml version="1.0" encoding="UTF-8"?>
And every time I reload that test script, the first character is different...

Any idea why ?

1

There are 1 answers

0
Tocacar On

It's working fine for me. Have you tried using a simple text editor and just saving your code snippet in it, saving it with a .php suffix in your web root and calling it from localhost? (that's what I did)

It may be that the editor you're using has an encoding issue (just a huge guess).