如何从PHP(SOAP)中的XML下方获取客户端钥匙值

发布于 2025-01-23 20:17:07 字数 2768 浏览 1 评论 0原文

<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:tns="https://consumerconnectws.tui.transunion.com/" xmlns:http="http://schemas.microsoft.com/ws/06/2004/policy/http" ><soap:Header></soap:Header><soap:Body><VerifyAuthenticationQuestions xmlns="https://consumerconnectws.tui.transunion.com/"><request><q19:AccountCode>***</q19:AccountCode><q19:AccountName>***</q19:AccountName><q19:RequestKey>8b5a839e-156c-4800-8361-8ca1bcf4d04e</q19:RequestKey><q19:ClientKey>57a5c69a2a8b1</q19:ClientKey><q19:Answers xmlns:q19="https://consumerconnectws.tui.transunion.com/data"><![CDATA[<ArrayOfVerifyChallengeAnswersRequestMultiChoiceQuestion xmlns="com/truelink/ds/sch/srv/iv/ccs"><VerifyChallengeAnswersRequestMultiChoiceQuestion><QuestionId>***</QuestionId><SelectedAnswerChoice><AnswerChoiceId>***</AnswerChoiceId></SelectedAnswerChoice></VerifyChallengeAnswersRequestMultiChoiceQuestion><VerifyChallengeAnswersRequestMultiChoiceQuestion><QuestionId>***</QuestionId><SelectedAnswerChoice><AnswerChoiceId>***</AnswerChoiceId></SelectedAnswerChoice></VerifyChallengeAnswersRequestMultiChoiceQuestion><VerifyChallengeAnswersRequestMultiChoiceQuestion><QuestionId>***</QuestionId><SelectedAnswerChoice><AnswerChoiceId>***</AnswerChoiceId></SelectedAnswerChoice></VerifyChallengeAnswersRequestMultiChoiceQuestion></ArrayOfVerifyChallengeAnswersRequestMultiChoiceQuestion>]]></q19:Answers><q19:ServiceBundleFulfillmentKey xmlns:q19="https://consumerconnectws.tui.transunion.com/data">bbb0beaf-10ee-4f09-a972-50c9fb8aade0</q19:ServiceBundleFulfillmentKey></request></VerifyAuthenticationQuestions></soap:Body></soap:Envelope>

我需要获取Q19:ClientKey的值。 以下是我尝试过的代码

$soap     = @simplexml_load_string($xmldata,'SimpleXMLElement', LIBXML_NOCDATA | LIBXML_NOBLANKS);
$response = $soap->children('http://schemas.xmlsoap.org/soap/envelope/')->Body->children()->VerifyAuthenticationQuestions->request;

: simplexmlelement对象

(
[q19:AccountCode] => ***
[q19:AccountName] => ***
[q19:RequestKey] => 8b5a839e-156c-4800-8361-8ca1bcf4d04e
[q19:ClientKey] => 57a5c69a2a8b1

我现在需要clientkey如何获取它

<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:tns="https://consumerconnectws.tui.transunion.com/" xmlns:http="http://schemas.microsoft.com/ws/06/2004/policy/http" ><soap:Header></soap:Header><soap:Body><VerifyAuthenticationQuestions xmlns="https://consumerconnectws.tui.transunion.com/"><request><q19:AccountCode>***</q19:AccountCode><q19:AccountName>***</q19:AccountName><q19:RequestKey>8b5a839e-156c-4800-8361-8ca1bcf4d04e</q19:RequestKey><q19:ClientKey>57a5c69a2a8b1</q19:ClientKey><q19:Answers xmlns:q19="https://consumerconnectws.tui.transunion.com/data"><![CDATA[<ArrayOfVerifyChallengeAnswersRequestMultiChoiceQuestion xmlns="com/truelink/ds/sch/srv/iv/ccs"><VerifyChallengeAnswersRequestMultiChoiceQuestion><QuestionId>***</QuestionId><SelectedAnswerChoice><AnswerChoiceId>***</AnswerChoiceId></SelectedAnswerChoice></VerifyChallengeAnswersRequestMultiChoiceQuestion><VerifyChallengeAnswersRequestMultiChoiceQuestion><QuestionId>***</QuestionId><SelectedAnswerChoice><AnswerChoiceId>***</AnswerChoiceId></SelectedAnswerChoice></VerifyChallengeAnswersRequestMultiChoiceQuestion><VerifyChallengeAnswersRequestMultiChoiceQuestion><QuestionId>***</QuestionId><SelectedAnswerChoice><AnswerChoiceId>***</AnswerChoiceId></SelectedAnswerChoice></VerifyChallengeAnswersRequestMultiChoiceQuestion></ArrayOfVerifyChallengeAnswersRequestMultiChoiceQuestion>]]></q19:Answers><q19:ServiceBundleFulfillmentKey xmlns:q19="https://consumerconnectws.tui.transunion.com/data">bbb0beaf-10ee-4f09-a972-50c9fb8aade0</q19:ServiceBundleFulfillmentKey></request></VerifyAuthenticationQuestions></soap:Body></soap:Envelope>

I need to get values of q19:ClientKey.
Below is the code i tried

$soap     = @simplexml_load_string($xmldata,'SimpleXMLElement', LIBXML_NOCDATA | LIBXML_NOBLANKS);
$response = $soap->children('http://schemas.xmlsoap.org/soap/envelope/')->Body->children()->VerifyAuthenticationQuestions->request;

out put :
SimpleXMLElement Object

(
[q19:AccountCode] => ***
[q19:AccountName] => ***
[q19:RequestKey] => 8b5a839e-156c-4800-8361-8ca1bcf4d04e
[q19:ClientKey] => 57a5c69a2a8b1

)

I need ClientKey now how to get it

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文