Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /********* JQUERY ***************/
- var settings = {
- "url": "https://ec.europa.eu/taxation_customs/vies/services/checkVatService",
- "method": "POST",
- "timeout": 0,
- "headers": {
- "Content-Type": "text/plain",
- "Cookie": "JSESSIONID=Ftckke83MgxmHiawNT4IFdE91wT5wtvAYuNt9tFl7_lZzWlUlYoO!1091839786"
- },
- "data": "<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\"\r\n xmlns:tns1=\"urn:ec.europa.eu:taxud:vies:services:checkVat:types\"\r\n xmlns:impl=\"urn:ec.europa.eu:taxud:vies:services:checkVat\">\r\n <soap:Header>\r\n </soap:Header>\r\n <soap:Body>\r\n <tns1:checkVat xmlns:tns1=\"urn:ec.europa.eu:taxud:vies:services:checkVat:types\"\r\n xmlns=\"urn:ec.europa.eu:taxud:vies:services:checkVat:types\">\r\n <tns1:countryCode>EL</tns1:countryCode>\r\n <tns1:vatNumber>000000000</tns1:vatNumber>\r\n </tns1:checkVat>\r\n </soap:Body>\r\n</soap:Envelope>\r\n",
- };
- $.ajax(settings).done(function (response) {
- console.log(response);
- });
- /********* XHR ***************/
- var data = "<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\"
- \n xmlns:tns1=\"urn:ec.europa.eu:taxud:vies:services:checkVat:types\"
- \n xmlns:impl=\"urn:ec.europa.eu:taxud:vies:services:checkVat\">
- \n <soap:Header>
- \n </soap:Header>
- \n <soap:Body>
- \n <tns1:checkVat xmlns:tns1=\"urn:ec.europa.eu:taxud:vies:services:checkVat:types\"
- \n xmlns=\"urn:ec.europa.eu:taxud:vies:services:checkVat:types\">
- \n <tns1:countryCode>EL</tns1:countryCode>
- \n <tns1:vatNumber>000000000</tns1:vatNumber>
- \n </tns1:checkVat>
- \n </soap:Body>
- \n</soap:Envelope>
- \n";
- var xhr = new XMLHttpRequest();
- xhr.withCredentials = true;
- xhr.addEventListener("readystatechange", function() {
- if(this.readyState === 4) {
- console.log(this.responseText);
- }
- });
- xhr.open("POST", "https://ec.europa.eu/taxation_customs/vies/services/checkVatService");
- xhr.setRequestHeader("Content-Type", "text/plain");
- xhr.setRequestHeader("Cookie", "JSESSIONID=Ftckke83MgxmHiawNT4IFdE91wT5wtvAYuNt9tFl7_lZzWlUlYoO!1091839786");
- xhr.send(data);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement