A do-it yourself blog
Posts tagged monster.com
Dealing with Monster.com SOAP with PHP5
0635 days
Recently I had to set up a system that would post a job offer to monster.com web service using SOAP.
Once I made the script to generate the XML I started looking into the SOAP class that PHP5 provides but I soon started to feel the headache comming !
So I justed wanted to help out If some of you were facing the same issue : FORGET that soap class and use a basic CURL !
Here is my code snippet
$headers=array("Accept: text/xml","Content-Type: text/xml");
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL,"https://208.71.198.74:8443/bgwBroker");
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $xml); // your soap xml that you generated earlier
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
$return = curl_exec($curl);
curl_close ($curl);
And there you go ! you just have to handle the return info.
I hope that this will help someone one day !

Last comments