sanjay.ibsindia Posted June 2, 2012 Share Posted June 2, 2012 hi, i am getting below code <tss_loan_response><signature><data name="page">app_completed</data><data name="site_type">soap_pw</data><data name="license_key">lic.olp.bb.sample</data><data name="promo_id">99999</data><data name="promo_sub_code">test</data><data name="unique_id">342a9710e6598d4ed65e298da691497b</data><data name="environment">testing</data></signature><errors/><content><section><url>https://rcredirect.tridentsecuredata.com/342a9710e6598d4ed65e298da691497b</url></section></content><collection><data name="client_url_root">INTERNETBUSINESSSOLUTIONSINDIA.COM</data><data name="client_ip_address">122.161.164.58</data><data name="customer_id">10100101</data></collection></tss_loan_response> i want to separate all values, i am using below code for generate this response define('XML_PAYLOAD', '<?xml version="1.0"?><tss_loan_response><signature><data name="site_type">soap_pw</data><data name="page">app_allinone</data><data name="license_key">lic.olp.bb.sample</data><data name="promo_id">99999</data><data name="promo_sub_code">test</data></signature><collection><data name="bank_aba">123123123</data><data name="bank_account">1232454124541</data><data name="bank_account_type">CHECKING</data><data name="bank_length_months">15</data><data name="bank_name">NORTHBANK</data><data name="client_ip_address">122.161.164.58</data><data name="client_url_root">internetbusinesssolutionsindia.com</data><data name="customer_id">10100101</data><data name="date_dob_d">02</data><data name="date_dob_m">05</data><data name="date_dob_y">1987</data><data name="email_primary">[email protected]</data><data name="employer_length_months">57</data><data name="employer_name">FUTURE</data><data name="home_city">jaipur</data><data name="home_state">AL</data><data name="home_street">devimarg</data><data name="home_zip">33068</data><data name="income_date1_d">01</data><data name="income_date1_m">02</data><data name="income_date1_y">2013</data><data name="income_date2_d">02</data><data name="income_date2_m">02</data><data name="income_date2_y">2014</data><data name="income_direct_deposit">FALSE</data><data name="income_frequency">WEEKLY</data><data name="income_monthly">500</data><data name="income_type">EMPLOYMENT</data><data name="loan_amount_desired">1000</data><data name="military">FALSE</data><data name="name_first">sanjay</data><data name="name_last">chaturvedi</data><data name="phone_home">9893169444</data><data name="phone_work">9893169444</data><data name="residence_length_months">5</data><data name="residence_type">RENT</data><data name="ssn_part_1">123</data><data name="ssn_part_2">45</data><data name="ssn_part_3">6789</data><data name="state_id_number">324654654165</data><data name="state_issued_id">AL</data></collection></tss_loan_response>'); define('XML_POST_URL', 'https://rc.tridentsecuredata.com/xml/1.0'); $ch = curl_init(XML_POST_URL);; curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml')); curl_setopt($ch, CURLOPT_POSTFIELDS, XML_PAYLOAD); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); echo $output = curl_exec($ch); curl_close($ch); This is partner weekly test code (check attachment) 18513_.pdf Link to comment https://forums.phpfreaks.com/topic/263527-php-xml-response/ Share on other sites More sharing options...
silkfire Posted June 2, 2012 Share Posted June 2, 2012 What do you mean by "separate"? Link to comment https://forums.phpfreaks.com/topic/263527-php-xml-response/#findComment-1350544 Share on other sites More sharing options...
sanjay.ibsindia Posted June 2, 2012 Author Share Posted June 2, 2012 separate means how to get value of page in <data name="page">, value of site_type <data name="site_type">, it means i will get app_completed and soap_pw as result. Link to comment https://forums.phpfreaks.com/topic/263527-php-xml-response/#findComment-1350546 Share on other sites More sharing options...
smoseley Posted June 2, 2012 Share Posted June 2, 2012 He means "parse". $data = simplexml_load_string($output); print_r($data); Link to comment https://forums.phpfreaks.com/topic/263527-php-xml-response/#findComment-1350547 Share on other sites More sharing options...
sanjay.ibsindia Posted June 2, 2012 Author Share Posted June 2, 2012 Thanks i have got result in below format SimpleXMLElement Object ( [signature] => SimpleXMLElement Object ( [data] => Array ( [0] => app_completed [1] => soap_pw [2] => lic.olp.bb.sample [3] => 99999 [4] => test [5] => 5bb672c0600858371f3ce7b194f174d6 [6] => testing ) ) [errors] => SimpleXMLElement Object ( ) [content] => SimpleXMLElement Object ( [section] => SimpleXMLElement Object ( [url] => https://rcredirect.tridentsecuredata.com/5bb672c0600858371f3ce7b194f174d6 ) ) [collection] => SimpleXMLElement Object ( [data] => Array ( [0] => INTERNETBUSINESSSOLUTIONSINDIA.COM [1] => 122.161.164.58 [2] => 10100101 ) ) ) how to do next for get the value app_completed Link to comment https://forums.phpfreaks.com/topic/263527-php-xml-response/#findComment-1350554 Share on other sites More sharing options...
smoseley Posted June 2, 2012 Share Posted June 2, 2012 $data->signature->data[0]; Link to comment https://forums.phpfreaks.com/topic/263527-php-xml-response/#findComment-1350559 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.