Author | Topic: SOAP client for confirms the VAT number in Europe | |
---|---|---|
Mario Garritano | SOAP client for confirms the VAT number in Europe on Wed, 25 Nov 2015 10:42:25 +0100 Hello everyone, I am trying to use a SOAP service that confirms the VAT number in Europe. It exists in http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl . Now, if I use it as the SOAP examples I get a string "soap:Client" with no other content. What is the error? Thank you all TEST-MIO.PRG | |
Boris Borzic | Re: SOAP client for confirms the VAT number in Europe on Wed, 25 Nov 2015 18:43:07 +0100 Mario Garritano wrote in news:47de189c$28221f51$166@news.alaska-software.com: > I am trying to use a SOAP service that confirms the VAT number in > Europe. It exists in > http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl . Now, > if I use it as the SOAP examples I get a string "soap:Client" with no > other content. Here is a working example that uses the Xb2.NET library: oSoap := xbSOAPEnvelope():new() oSoap:SetStyle( SOAP_STYLE_DOCUMENT ) oSoap:NameSpace := "urn:ec.europa.eu:taxud:vies:services:checkVat:types" oSoap:SetVar("countryCode", upper(trim(cCode))) oSoap:SetVar("vatNumber" , upper(trim(cVat))) oResult := oSoap:Execute( "http://ec.europa.eu/taxation_customs/vies/services/checkVatService", "checkVat") ? oResult:getVar() More info on Xb2.NET here: http://xb2.net/xb2net/ Best regards, Boris Borzic http://xb2.net http://sqlexpress.net industrial strength Xbase++ development tools | |
Damir Hodak | Re: SOAP client for confirms the VAT number in Europe on Thu, 26 Nov 2015 12:09:47 +0100 On Wed, 25 Nov 2015 10:42:25 +0100, Mario Garritano wrote: > Hello everyone, > I am trying to use a SOAP service that confirms the VAT number in Europe. It > exists in http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl . > Now, if I use it as the SOAP examples I get a string "soap:Client" with no > other content. > What is the error? > Thank you all Hi Mario! I use following code and it works for me. #pragma library( "ascom10.lib" ) #define VIES_URL 'http://ec.europa.eu/taxation_customs/vies/services/checkVatService' #define VIES_SOAP_NAMESPACE 'urn:ec.europa.eu:taxud:vies:services:checkVat:types' #define CRLF Chr(13) + Chr(10) oXmlHttp := CreateObject("MSXML2.XMLHTTP") oXmlHttp:Open( "POST", VIES_URL, .F. ) oXmlHttp:SetRequestHeader( "SOAPAction", VIES_URL ) oXmlHttp:Send("<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:urn='" + VIES_SOAP_NAMESPACE + "'>" + CRLF + ; "<soapenv:Header/>" + CRLF + ; "<soapenv:Body>" + CRLF + ; " <urn:checkVat>" + CRLF + ; " <urn:countryCode>" + cVIESCountryCode + "</urn:countryCode>" + CRLF + ; " <urn:vatNumber>" + cVIESVATNumber + "</urn:vatNumber>" + CRLF + ; " </urn:checkVat>" + CRLF + ; "</soapenv:Body>" + CRLF + ; "</soapenv:Envelope>" + CRLF) result is in oXmlHttp:responsexml:xml Regards Damir |