0

I have a strange problem. In PHP I want to communicate to a Web Service with SOAP.

$soapURL = "http://www.somedomain.com/xyz.asmx?WSDL";
$soapParameters = Array('login' => "123", 'password' => "pwd", 'soap_version' => SOAP_1_2, 'exceptions' => True) ;
$client = new SoapClient($soapURL, $soapParameters);

With XAMPP it works locally without problems.

When I try it on my web server, I get the following error message:

Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://www.somedomain.com/xyz.asmx?WSDL' : Input is not proper UTF-8, indicate encoding ! Bytes: 0xFC 0x6C 0x74 0x69 in ...

The error raises at the last line of my code example.

Any Ideas?

  • mb_detect_encoding($soapURL); says the String is of format ASCII
  • I tried to convert every string to UTF-8 with utf8_encode, iconv and mb_convert_encoding...
  • first line of php file is: header('Content-type: text/html; charset=utf-8');
Hkachhia
  • 4,463
  • 6
  • 41
  • 76
Ziagl
  • 492
  • 2
  • 8
  • 22
  • 1
    check the file encoding for your file.php – Elzo Valugi Oct 29 '12 at 08:47
  • I don't know how. I simply pushed the files with FTP to the server. The server only has a webinterface. When I edit the php File, the Web-Editor sayd the encoding is UTF-8. – Ziagl Oct 29 '12 at 08:53
  • download the file and look at its properties using a good editor. I use Zend Studio, but notepad++, or gedit on linux I think can tell you what is the encoding of the file and even let you change it. – Elzo Valugi Oct 29 '12 at 09:19
  • thanks, but the editor says the the file is UTF-8 encoded – Ziagl Oct 29 '12 at 09:27
  • now you know is not this the issue. Start looking at the contents of what is coming, probably is something not properly encoded in the content. – Elzo Valugi Oct 29 '12 at 12:55
  • seen this? http://stackoverflow.com/questions/4662008/another-php-xml-parsing-error-input-is-not-proper-utf-8-indicate-encoding – Elzo Valugi Oct 29 '12 at 12:59

1 Answers1

0

I finally solved it. The problem was the communication from Windows server and Linux client. I don't know why it works on some Linux machines, but never mind.

I added a local wsdl file at the source and use that for the SOAPClient. For the server I used the __setLocation function.

Ziagl
  • 492
  • 2
  • 8
  • 22