我有一个奇怪的问题。在PHP
我想用 SOAP 与 Web 服务通信。
$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);
使用 XAMPP,它可以在本地正常工作。
当我在我的网络服务器上尝试它时,我收到以下错误消息:
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 ...
错误出现在我的代码示例的最后一行。
有任何想法吗?
mb_detect_encoding($soapURL);
表示字符串的格式为 ASCII- 我尝试使用和 mb_convert_encoding将每个字符串转换为 UTF-8
utf8_encode
...iconv
- php文件的第一行是:
header('Content-type: text/html; charset=utf-8');