2

我正在尝试连接到下一个网络服务:

https://grab.beta.agiv.be/Tools/CRABTools.svc?wsdl

我还必须添加一个我已经创建的标题元素。

我可以只使用 PHP 调用它吗soapclientzend_soap_client还是我必须使用nusoap_client

我尝试类似:

$soapclient = new nusoap_client($wsdl);
$header = "<o:Security s:mus... ../>"; // including my password and username

$soapclient->call("FindGemeentenResult",
array("houseNumberId" => 2306852),
"https://grab.beta.agiv.be/Tools/CRABTools.svc",
"http://ws.agiv.be/crabtools/ICRABTools/FindGemeentenResult",
$header);

但现在我得到:

Error: HTTP Error: Unsupported HTTP response status 415 Cannot process the message because the content type 'text/xml; charset=ISO-8859-1' was not the expected type 'text/xml; charset=utf-8'.(soapclient->response 有响应的内容)

我对此很陌生,欢迎任何帮助!

4

2 回答 2

7

在调用服务器上的方法之前,您需要将 SOAP 客户端编码设置为utf-8而不是默认值。ISO-8859-1

例如

$soapclient = new nusoap_client(...);
$soapclient->soap_defencoding = 'UTF-8';
$soapclient->call(...);
于 2010-06-26T15:14:14.300 回答
5
/**
* charset encoding for outgoing messages
*
* @var      string
* @access   public
*/
  var $soap_defencoding = 'UTF-8';
 //var $soap_defencoding = 'ISO-8859-1';
于 2012-10-17T10:53:38.680 回答