所以我试图在我的SOAP请求中包含以下XML:
someint
someint
someint
someint
我查看了this的帖子,这个帖子含糊不清,但它产生的输出如下:
object(stdClass)#1 (1) {
["Responses"]=>
object(stdClass)#2 (1) {
["Response"]=>
array(2) {
[0]=>
object(stdClass)#3 (2) {
["QuestionAnswerID"]=>
int(someint)
["QuestionID"]=>
int(someint)
}
[1]=>
object(stdClass)#4 (2) {
["QuestionAnswerID"]=>
int(someint)
["SurveyQuestionID"]=>
int(someint)
}
}
}
}
问题是数组现在有索引,我正在调用的Web服务似乎不喜欢.我可以用任何方式生成类似上面的XML吗?
TIA.
解决方法:
没有带有WSDL的SOAP服务器就很难对此进行测试.您应该能够创建关联数组,如下所示:
$responses = array();
$responses[] = array("QuestionAnswerID" => someint, "QuestionID" => someint);
$responses[] = array("QuestionAnswerID" => someint, "QuestionID" => someint);
$response = array("Response" => $responses);
$soapData = array("Responses" => $response);
标签:php,arrays,soap,xml
来源: https://codeday.me/bug/20190722/1499025.html