如何从PHP(SOAP)中的XML下方获取客户端钥匙值
<?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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论