dougu9895 2012-10-29 08:33
浏览 56
已采纳

SOAP UTF-8编码

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');
  • 写回答

1条回答 默认 最新

  • doulingzou1712 2012-10-30 14:24
    关注

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?