Php 在SoapServer响应上添加HTTP头
有没有办法在SoapServer的响应中添加HTTP头 例如:我想添加我的SoapServer的响应 “位置” HTTP/1.1 307临时重定向 地点: 内容类型:text/xml;charset=“utf-8” 内容长度:100Php 在SoapServer响应上添加HTTP头,php,http,soap,soapheader,soapserver,Php,Http,Soap,Soapheader,Soapserver,有没有办法在SoapServer的响应中添加HTTP头 例如:我想添加我的SoapServer的响应 “位置” HTTP/1.1 307临时重定向 地点: 内容类型:text/xml;charset=“utf-8” 内容长度:100 向Soap添加更多数据的非常简单的方法是 function add_custom_data() { $outerObj = new stdClass(); $innerObj = new stdClass();
向Soap添加更多数据的非常简单的方法是
function add_custom_data() {
$outerObj = new stdClass();
$innerObj = new stdClass();
$innerObj->data1 = "MyData";
$innerObj->data2 = "MyData2";
$outerObj->innerObj = $innerObj;
return $outerObj;
}
对于Soap,定义文件必须与请求/响应中的元素匹配。在Soap服务器中,只需添加:
header('Location: http://localhost');
这将自动添加“位置”标题并更改响应代码。您是否使用PHP提供的
SoapClient
?@abdulrashid YesRead这是您找到这个问题的答案了吗。