-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvat.js
57 lines (47 loc) · 1.95 KB
/
vat.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
$(document).ready(function(){
function buildMessage(){
var message =
'<?xml version="1.0" encoding="UTF-8" standalone="no"?>' +
'<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" '+
'xmlns:tns1="urn:ec.europa.eu:taxud:vies:services:checkVat:types" ' +
'xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" ' +
'xmlns:impl="urn:ec.europa.eu:taxud:vies:services:checkVat" ' +
'xmlns:apachesoap="http://xml.apache.org/xml-soap" ' +
'xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" ' +
'xmlns:xsd="http://www.w3.org/2001/XMLSchema" ' +
'xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" ' +
'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > ' +
'<SOAP-ENV:Body>' +
'<tns1:checkVat xmlns:tns1="urn:ec.europa.eu:taxud:vies:services:checkVat:types">' +
'<tns1:countryCode>NL</tns1:countryCode>' +
'<tns1:vatNumber>809808572B01</tns1:vatNumber>' +
'</tns1:checkVat></SOAP-ENV:Body></SOAP-ENV:Envelope>'
return message;
}
function checkVat(){
// var soapMessage = buildMessage();
// var serviceUrl = "http://ec.europa.eu/taxation_customs/vies/services/checkVatService";
//
// var jsonObject = jQuery.parseJSON('{"countryCode":"NL","vatNumber":"809808572B01"}');
//console.log(jsonObject);
//return;
// $.ajax({
// url: serviceUrl,
// type: "POST",
// dataType: "xml",
// data: soapMessage,
// crossDomain:true,
// success: function(response){
// console.log(response);
// }
// });
$.ajax({
url: "VatService.php",
type: "GET",
success: function(response){
console.log(response);
}
})
}
checkVat();
})