[dba-VB] Access data across the internet. Now: Look up EU VAT No.

Gustav Brock Gustav at cactus.dk
Mon Aug 31 12:21:15 CDT 2009


Hi Doug et al

I just tested this with the code referred to by Shamil:

"How to Consume a Web Service"

http://johnwsaundersiii.spaces.live.com/?_c11_BlogPart_BlogPart=blogview&_c=BlogPart&partqs=amonth%3d5%26ayear%3d2009

I created another service reference, ServiceEuViesCheckReference, and ran this code:

            using (var svc = new ServiceEuViesCheckReference.checkVatPortTypeClient())
            {
                string countryCode = "DK";
                string vatNumber = "12002696";
                bool valid = false;
                string name = String.Empty;
                string address = String.Empty;
                DateTime responseDate = svc.checkVat(
                    ref countryCode, ref vatNumber,
                    out valid, out name, out address);
                Console.WriteLine(responseDate.ToShortDateString());
                Console.WriteLine(valid.ToString());
                Console.WriteLine(name);
                Console.WriteLine(address);
                Console.Write("Press a key");
                Console.ReadLine();
            }

This returns correctly:

---
31-08-2009
True
CACTUS DATA APS
KALKBRÆNDERILØBSKAJ 4A

2100 KØBENHAVN Ø
Press a key
---

This is fun!
Response time is about 1 second.

/gustav


>>> Gustav at cactus.dk 31-08-2009 14:06 >>>
Hi Doug

If you ask for an example of a public service, an example is here - from the EU to provide validation of VAT registration of companies of the EU:

http://ec.europa.eu/taxation_customs/vies/api/checkVatPort?wsdl 

It is very simple as no user credentials are requested, thus it should work with most clients.

/gustav


>>> dbdoug at gmail.com 30-08-2009 23:47 >>>
Hi Gustav (and Shamil)

I've been following this discussion with some interest.  My impression of
web services is that they are basically for publishing information (like a
parts catalogue) which could be read and used by clients.  I gather that
this is not the whole picture.

I've spent several hours on the web recently trying to get more information;
however I have yet to stumble on a site which gives a clear explanation
and/or some practical examples.  Do you have any good references?

Thanks,

Doug Steele





More information about the dba-VB mailing list