Forums: 
Hello everyone,

The XML server automatically gets a 4, but I get no response . The answers are empty. Any idea?

Best regards,

Daniel Barbe.

<!DOCTYPE html>

<html>
<head>
<script>

var xmlhttp;
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }

    
  var httpRequest = null;
if(window.XMLHttpRequest) { // Mozilla, Safari, Firefox ...
  httpRequest = new XMLHttpRequest();
  if (httpRequest.overrideMimeType) {
    httpRequest.overrideMimeType('text/xml');
  }
}else if (window.ActiveXObject) { // IE
  httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
}

 maquery = "<QUERIES><LANG>eng</LANG>"
  +"<AUTH><CLIENT>123456789-A1556899C8BC49E7FA710EDE42C74E7Z</CLIENT></AUTH>"
  +"<QUERY CMD='ALBUM_SEARCH'><TEXT TYPE='ARTIST'>flying lotus</TEXT><TEXT TYPE='ALBUM_TITLE'>until the quiet comes</TEXT>"
    +"<TEXT TYPE='TRACK_TITLE'>all in</TEXT></QUERY></QUERIES>";
    
httpRequest.open('POST', 'https://c123456789.web.cddbp.net/webapi/xml/1.0/',true);
httpRequest.setRequestHeader('Content-type','application/x-www-form-urlencoded');
httpRequest.send(maquery);

  function mafonction(){
  //action
  if (httpRequest.readyState==4 && httpRequest.status==200)
    {
    alert(httpRequest.readyState);
    }
      alert(httpRequest.readyState);

  if(httpRequest.getResponseHeader("Content-Type") == "text/xml"){
    alert(httpRequest.responseXML);
    alert("Réponse XML");
  }else{
  
    alert(httpRequest.responseText);
        alert("Réponse TXT");

  }

 

          
} //end

m.onreadystatechange = mafonction;

</script>
</head>

<body>

<h2>My CD Collection..:</h2>
<div id="myDiv1"></div>
<button type="button" onclick="mafonction()">Get my CD collection</button>
</body>
</html>

Hi Daniel,
Currently, we do not allow cross-origin requests. This is most likely why you are not getting any response.
A workaround will be to set up your web server and let it handle the query, then return the query result.
Hope this helps.
Best,

Hi,

Thanks for your answer. My english is not perfect but i understand.

I thought it was possible to send directly a "TOC" with a simple request and get a response !

Is there another way to get information on a CD without using a traditional software?

Best regards,

Daniel

Forum Discussions