How to POST XML data in codeigniter?

#9
[eluser]wahyusumartha[/eluser]
okay.. i will share the code Smile..
i want to post xml to web service server..

so i write controller like this :

function add_customer() {

$post = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\n";
$post .= "<customer>\n";
$post .= "<firstname>sinichi</firstname>\n";
$post .= "<lastname>kudo</lastname>\n";
$post .= "</customer>\n";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,
"http://localhost:9090/TestRestful/resources/customersservice/add");
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$res = curl_exec($ch);
curl_close ($ch);
echo $res;
}

controller above have a function to post xml data to web service server using curl Smile..
are you understand my problem previously now ? Smile


Messages In This Thread
How to POST XML data in codeigniter? - by El Forum - 01-10-2010, 12:16 PM
How to POST XML data in codeigniter? - by El Forum - 01-10-2010, 03:42 PM
How to POST XML data in codeigniter? - by El Forum - 01-10-2010, 09:03 PM
How to POST XML data in codeigniter? - by El Forum - 01-10-2010, 11:57 PM
How to POST XML data in codeigniter? - by El Forum - 01-11-2010, 12:07 AM
How to POST XML data in codeigniter? - by El Forum - 01-11-2010, 12:43 AM
How to POST XML data in codeigniter? - by El Forum - 01-11-2010, 01:00 AM
How to POST XML data in codeigniter? - by El Forum - 01-11-2010, 04:02 AM
How to POST XML data in codeigniter? - by El Forum - 01-11-2010, 10:25 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.