首页 > 解决方案 > SOAP 客户端错误编码

问题描述

我正在尝试使用 PHP 的 SOAP 客户端。连接工作正常,但响应总是充满问号和换行符 (/n)。

我如何将 utf 8 设置为我的 SOAP 连接,或者是否有可能,所以将响应设置为 json?

这是我的代码:

$c = new SoapClient('https://example.com/services/ShipmentService/V4_3?wsdl');
        $token = [
            'delisId'         => $auth->delisId,
            'authToken'       => $auth->authToken,
            'messageLanguage' => 'de_DE',
        ];
        $header = new SOAPHeader('http://example.com/common/service/types/Authentication/2.0', 'authentication', $token);
        $c->__setSoapHeaders($header);

 $response = $c->storeOrders(...);

标签: phpsoapencoding

解决方案


推荐阅读