php - 如何在 PHP 中为 SOAP 客户端正确设置 Cookie/Header?
问题描述
我正在尝试根据我在那里找到的几个主题启用对 SOAP 调用的 xDebug 支持(请参阅本文末尾的列表),这就是我到目前为止所做的:
$this->_client_soap = new SoapClient(
$this->ecase_wsdl,
array(
'trace' => 1,
'exceptions' => true,
'soap_version' => SOAP_1_1,
'cache_wsdl' => WSDL_CACHE_NONE
)
);
// Xdebug Support
$xdebug_remote_address = $this->CI->config->item('xdebug_remote_address');
$xdebug_cookie = $this->CI->config->item('xdebug_cookie');
if ($xdebug_remote_address && $xdebug_cookie) {
$this->_client_soap->setCookie('X-Xdebug-Remote-Address', $xdebug_remote_address);
$this->_client_soap->setCookie('Cookie', $xdebug_cookie);
}
$soap_string = $this->build_add_new_case_xml_string();
$ecase_response = $this->_client_soap->__doRequest(
$soap_string,
$this->ecase_wsdl,
$this->service,
SOAP_1_1
);
但我收到以下SoapFault
错误消息:
Function ("setCookie") is not a valid method for this service
我在这里缺少什么?设置 Cookie/Header 的正确方法是什么?我的 PHP 版本是 5.3.3
之前检查的文章:
解决方案
推荐阅读
- laravel - Laravel 返回“CSRF 令牌不匹配”,尽管 CSRF 令牌已包含在内且明显正确
- javascript - 在 Nuxt / Vuex 存储中定义 setter 和 getter 以进行 API 访问
- python - 将两个字典与满足多个条件的值列表进行比较
- c# - 无法翻译 LINQ 表达式
- javascript - 每次从 jquery 弹出窗口中读取相同的文本框值
- javascript - Discord.JS - Hypixel Discord 机器人
- spring-boot - 不活动超时后自动关闭 Spring Boot
- apache-spark - 无法通过 SSMS 访问 Azure Synapse Spark 表
- ios - iOS - AWS Cognito 使用 JavaScript 获取访问密钥、秘密密钥为空
- java - 移动视觉未检测到二维码