How to cross domain call a xml web service?

I am a new developer and I have this simple xml web service to call:

The problem I have is that it is on another domain so I have to find a way to work it out, could anyone help?:slight_smile:

You’ll need to call it with cURL.

I used this function when I encountered a similar situation a couple years back.

     * load XML file using cURL from outside URL
     * if cURL is not available, this defaults to using simplexml_load_file()
     * @param string $url
    function simplexml_load_file_curl($url) {
        if(in_array('curl', get_loaded_extensions())){
            $ch = curl_init($url);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
            $xml = simplexml_load_string(curl_exec($ch));
            $xml = simplexml_load_file($url);
        return $xml;

$xml = simplexml_load_file_curl('');

Then just treat it as a SimpleXMLElement: