473,770 Members | 2,096 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to use this service ??? WSDL available

Hello,

I've have a problem with a webservice. I just want to validate a VAT
number by country code and VAT numer. The return value should be like
"it's valid" and/or the name where it's registered to.

To do this i can access the webservice on the following location:
http://ec.europa.eu/taxation_customs...i/checkVatPort

A WSDL file is also available:
http://ec.europa.eu/taxation_customs...ckVatPort?wsdl.

My question is how can i get the results i want. Can someone help me
with just the little module that does the request.

I already right-click on Web reference and added
http://ec.europa.eu/taxation_customs...ckVatPort?wsdl, but
when i want to use checkvat(countr y,VAT), it exepect 3 other fields and
the return type seem to be date.

My understanding is that i only have to use 2 parameters (via XML ?),
and retrieve a string value (XML ?)

I just need something like
returnvalue = doRequest(count ry,VAT).valid
Name = returnvalue.Nam e
Valid = returnvalue.val id
etc.....
Thanks for all your help.

Regards,

Edje

Aug 29 '06
13 8466
adm

Edje wrote:
>
Did it work for you ?
Hi all,

I can confirm that this works:

Public Class Form1

Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click
Dim check As New eu.europa.ec.ch eckVatService
Dim countryCode As String = "CZ"
Dim vatNumber As String = "991231123"
Dim valid As Boolean
Dim currentDate As Date
Dim name As String = String.Empty
Dim address As String = String.Empty

currentDate = check.checkVat( countryCode, vatNumber, valid,
name, address)
Me.TextBox1.Tex t = currentDate.ToS tring
End Sub
End Class

It will put the date (as returned by the webservice) in the text box.
Thanks to Tom for the code.

adm

Aug 30 '06 #11

Edje wrote:
Tom Shelton schreef:
Edje wrote:
Tom Shelton schreef:
>
Tom Shelton wrote:
Ed*********@gma il.com wrote:
Hello,

I've have a problem with a webservice. I just want to validate a VAT
number by country code and VAT numer. The return value should be like
"it's valid" and/or the name where it's registered to.

To do this i can access the webservice on the following location:
http://ec.europa.eu/taxation_customs...i/checkVatPort

A WSDL file is also available:
http://ec.europa.eu/taxation_customs...ckVatPort?wsdl.

My question is how can i get the results i want. Can someone help me
with just the little module that does the request.

I already right-click on Web reference and added
http://ec.europa.eu/taxation_customs...ckVatPort?wsdl, but
when i want to use checkvat(countr y,VAT), it exepect 3 other fields and
the return type seem to be date.

My understanding is that i only have to use 2 parameters (via XML ?),
and retrieve a string value (XML ?)

I just need something like
returnvalue = doRequest(count ry,VAT).valid
Name = returnvalue.Nam e
Valid = returnvalue.val id
etc.....


Thanks for all your help.

Regards,

Edje
>
Option Strict On
Option Explicit On
>
Imports System
Imports ConsoleApplicat ion9.eu.europa. ec
>
Module Module1
>
Sub Main()
Dim check As New checkVatService ()
Dim countryCode As String = "CZ"
Dim vatNumber As String = "991 2311 23"
Dim valid As Boolean
Dim currentDate As Date
Dim name As String = String.Empty
Dim address As String = String.Empty
>
currentDate = check.checkVat( countryCode, vatNumber, valid,
name, address)
>
If valid Then
Console.WriteLi ne(name)
Console.WriteLi ne(address)
Console.WriteLi ne(currentDate)
Else
Console.WriteLi ne("invalid vat")
End If
End Sub
>
End Module
>
What I don't now a valid VAT, so I can't really test it. I just get
back valid = false. I imported this into C#, and it shows the
arguments as:
>
DateTime checkVat (ref string countryCode, ref string vatNumber, out
bool valid, out string name, out string address)
>
In C#, that means that the method will fill in the out parameters, and
you must supply the ref parameters. In c# that means you must
initailize first, and it must be saved as a variable. VB.NET will let
you get away with it by creating a temp value for you. But, as you can
see I declare all these values in the above code.... So, based on the
C# code I'm assuming that the VB.NET code actually works?
>
--
Tom Shelton

Boy - I meant to point out that I'm using the vat numbers supplied adm.
Didn't mean to take credit for that :) I was just trying to take his
example a little farther.

--
Tom Shelton
>
>
Tom,
>
I tried this code (with proxy server), but i get the following error:
"The request failed with HTTP status 417: Expectation Failed."
The error is on the following row:
currentDate = check.checkVat( countryCode, vatNumber, valid,
name, address)
>
Here is my code:
>
Option Strict On
Option Explicit On
Imports BTWCheck.eu.eur opa.ec
Imports System.Net
Imports System
>
>
Module Module1
>
Sub Main()
Dim check As New checkVatService ()
Dim countryCode As String = "BE"
Dim vatNumber As String = "4179951765 "
Dim valid As Boolean
Dim currentDate As Date
Dim datestring As String
Dim name As String = String.Empty
Dim address As String = String.Empty
' proxy settings
Dim cr As New System.Net.Netw orkCredential(" user", "pass",
"domain")
Dim pr As New System.Net.WebP roxy("10.0.0.9" , 8080)
pr.Credentials = cr
check.Proxy = pr
>
>
currentDate = check.checkVat( countryCode, vatNumber, valid,
name, address)
If valid Then
Console.WriteLi ne(name)
Console.WriteLi ne(address)
Console.WriteLi ne(currentDate)
Else
Console.WriteLi ne("invalid vat")
End If
End Sub
>
>
End Module
>
Thanks for your help.
>
>
Ed
Sorry Ed, I'm hitting the limits of my knowledge of web services. I
haven't ever tried to use a web service through a proxy. I'm assuming
that there is something wrong with your proxy settings? I
unfortuantely don't have a proxy server to try your code against, so I
have no way of helping here. Hopefully, someone will be able to help
you further with this issue.

--
Tom Shelton

Tom,

I don't think the proxy server si the issue, because i've tried it also
from home, with no proxy server and i receive the same error message.

Did it work for you ?

Thanks,

Ed
Well - it worked in that I don't receive an error with the code I
originally posted. All I get back is valid = false. I checked the VAT
on the eropa site and it also says it is invalid. So, to be honest
unless I have a known valid VAT, I have know way of really knowing if
it worked or not... I was hoping you could take my code, and insert a
known good VAT (one that validates on the website) and see what you get
back.

--
Tom Shelton

Aug 30 '06 #12

Tom Shelton schreef:
Edje wrote:
Tom Shelton schreef:
Edje wrote:
Tom Shelton schreef:

Tom Shelton wrote:
Ed*********@gma il.com wrote:
Hello,
>
I've have a problem with a webservice. I just want to validate a VAT
number by country code and VAT numer. The return value should be like
"it's valid" and/or the name where it's registered to.
>
To do this i can access the webservice on the following location:
http://ec.europa.eu/taxation_customs...i/checkVatPort
>
A WSDL file is also available:
http://ec.europa.eu/taxation_customs...ckVatPort?wsdl.
>
My question is how can i get the results i want. Can someone help me
with just the little module that does the request.
>
I already right-click on Web reference and added
http://ec.europa.eu/taxation_customs...ckVatPort?wsdl, but
when i want to use checkvat(countr y,VAT), it exepect 3 other fields and
the return type seem to be date.
>
My understanding is that i only have to use 2 parameters (via XML ?),
and retrieve a string value (XML ?)
>
I just need something like
returnvalue = doRequest(count ry,VAT).valid
Name = returnvalue.Nam e
Valid = returnvalue.val id
etc.....
>
>
Thanks for all your help.
>
Regards,
>
Edje

Option Strict On
Option Explicit On

Imports System
Imports ConsoleApplicat ion9.eu.europa. ec

Module Module1

Sub Main()
Dim check As New checkVatService ()
Dim countryCode As String = "CZ"
Dim vatNumber As String = "991 2311 23"
Dim valid As Boolean
Dim currentDate As Date
Dim name As String = String.Empty
Dim address As String = String.Empty

currentDate = check.checkVat( countryCode, vatNumber, valid,
name, address)

If valid Then
Console.WriteLi ne(name)
Console.WriteLi ne(address)
Console.WriteLi ne(currentDate)
Else
Console.WriteLi ne("invalid vat")
End If
End Sub

End Module

What I don't now a valid VAT, so I can't really test it. I just get
back valid = false. I imported this into C#, and it shows the
arguments as:

DateTime checkVat (ref string countryCode, ref string vatNumber, out
bool valid, out string name, out string address)

In C#, that means that the method will fill in the out parameters, and
you must supply the ref parameters. In c# that means you must
initailize first, and it must be saved as a variable. VB.NET will let
you get away with it by creating a temp value for you. But, as you can
see I declare all these values in the above code.... So, based on the
C# code I'm assuming that the VB.NET code actually works?

--
Tom Shelton
>
Boy - I meant to point out that I'm using the vat numbers supplied adm.
Didn't mean to take credit for that :) I was just trying to take his
example a little farther.
>
--
Tom Shelton


Tom,

I tried this code (with proxy server), but i get the following error:
"The request failed with HTTP status 417: Expectation Failed."
The error is on the following row:
currentDate = check.checkVat( countryCode, vatNumber, valid,
name, address)

Here is my code:

Option Strict On
Option Explicit On
Imports BTWCheck.eu.eur opa.ec
Imports System.Net
Imports System


Module Module1

Sub Main()
Dim check As New checkVatService ()
Dim countryCode As String = "BE"
Dim vatNumber As String = "4179951765 "
Dim valid As Boolean
Dim currentDate As Date
Dim datestring As String
Dim name As String = String.Empty
Dim address As String = String.Empty
' proxy settings
Dim cr As New System.Net.Netw orkCredential(" user", "pass",
"domain")
Dim pr As New System.Net.WebP roxy("10.0.0.9" , 8080)
pr.Credentials = cr
check.Proxy = pr


currentDate = check.checkVat( countryCode, vatNumber, valid,
name, address)
If valid Then
Console.WriteLi ne(name)
Console.WriteLi ne(address)
Console.WriteLi ne(currentDate)
Else
Console.WriteLi ne("invalid vat")
End If
End Sub


End Module

Thanks for your help.


Ed
>
Sorry Ed, I'm hitting the limits of my knowledge of web services. I
haven't ever tried to use a web service through a proxy. I'm assuming
that there is something wrong with your proxy settings? I
unfortuantely don't have a proxy server to try your code against, so I
have no way of helping here. Hopefully, someone will be able to help
you further with this issue.
>
--
Tom Shelton
Tom,

I don't think the proxy server si the issue, because i've tried it also
from home, with no proxy server and i receive the same error message.

Did it work for you ?

Thanks,

Ed

Well - it worked in that I don't receive an error with the code I
originally posted. All I get back is valid = false. I checked the VAT
on the eropa site and it also says it is invalid. So, to be honest
unless I have a known valid VAT, I have know way of really knowing if
it worked or not... I was hoping you could take my code, and insert a
known good VAT (one that validates on the website) and see what you get
back.

--
Tom Shelton

Tom,

Excuse me a lot, you were right. I made a mistake in my code. It works
perfectly, exactly what i needed !!!!!!!!

Thanks for your great help !!!!
Thanks,

Ed

Aug 30 '06 #13

Edje wrote:
Tom Shelton schreef:
Edje wrote:
Tom Shelton schreef:
>
Edje wrote:
Tom Shelton schreef:
>
Tom Shelton wrote:
Ed*********@gma il.com wrote:
Hello,

I've have a problem with a webservice. I just want to validate a VAT
number by country code and VAT numer. The return value should be like
"it's valid" and/or the name where it's registered to.

To do this i can access the webservice on the following location:
http://ec.europa.eu/taxation_customs...i/checkVatPort

A WSDL file is also available:
http://ec.europa.eu/taxation_customs...ckVatPort?wsdl.

My question is how can i get the results i want. Can someone help me
with just the little module that does the request.

I already right-click on Web reference and added
http://ec.europa.eu/taxation_customs...ckVatPort?wsdl, but
when i want to use checkvat(countr y,VAT), it exepect 3 other fields and
the return type seem to be date.

My understanding is that i only have to use 2 parameters (via XML ?),
and retrieve a string value (XML ?)

I just need something like
returnvalue = doRequest(count ry,VAT).valid
Name = returnvalue.Nam e
Valid = returnvalue.val id
etc.....


Thanks for all your help.

Regards,

Edje
>
Option Strict On
Option Explicit On
>
Imports System
Imports ConsoleApplicat ion9.eu.europa. ec
>
Module Module1
>
Sub Main()
Dim check As New checkVatService ()
Dim countryCode As String = "CZ"
Dim vatNumber As String = "991 2311 23"
Dim valid As Boolean
Dim currentDate As Date
Dim name As String = String.Empty
Dim address As String = String.Empty
>
currentDate = check.checkVat( countryCode, vatNumber, valid,
name, address)
>
If valid Then
Console.WriteLi ne(name)
Console.WriteLi ne(address)
Console.WriteLi ne(currentDate)
Else
Console.WriteLi ne("invalid vat")
End If
End Sub
>
End Module
>
What I don't now a valid VAT, so I can't really test it. I just get
back valid = false. I imported this into C#, and it shows the
arguments as:
>
DateTime checkVat (ref string countryCode, ref string vatNumber, out
bool valid, out string name, out string address)
>
In C#, that means that the method will fill in the out parameters, and
you must supply the ref parameters. In c# that means you must
initailize first, and it must be saved as a variable. VB.NET will let
you get away with it by creating a temp value for you. But, as you can
see I declare all these values in the above code.... So, based on the
C# code I'm assuming that the VB.NET code actually works?
>
--
Tom Shelton

Boy - I meant to point out that I'm using the vat numbers supplied adm.
Didn't mean to take credit for that :) I was just trying to take his
example a little farther.

--
Tom Shelton
>
>
Tom,
>
I tried this code (with proxy server), but i get the following error:
"The request failed with HTTP status 417: Expectation Failed."
The error is on the following row:
currentDate = check.checkVat( countryCode, vatNumber, valid,
name, address)
>
Here is my code:
>
Option Strict On
Option Explicit On
Imports BTWCheck.eu.eur opa.ec
Imports System.Net
Imports System
>
>
Module Module1
>
Sub Main()
Dim check As New checkVatService ()
Dim countryCode As String = "BE"
Dim vatNumber As String = "4179951765 "
Dim valid As Boolean
Dim currentDate As Date
Dim datestring As String
Dim name As String = String.Empty
Dim address As String = String.Empty
' proxy settings
Dim cr As New System.Net.Netw orkCredential(" user", "pass",
"domain")
Dim pr As New System.Net.WebP roxy("10.0.0.9" , 8080)
pr.Credentials = cr
check.Proxy = pr
>
>
currentDate = check.checkVat( countryCode, vatNumber, valid,
name, address)
If valid Then
Console.WriteLi ne(name)
Console.WriteLi ne(address)
Console.WriteLi ne(currentDate)
Else
Console.WriteLi ne("invalid vat")
End If
End Sub
>
>
End Module
>
Thanks for your help.
>
>
Ed

Sorry Ed, I'm hitting the limits of my knowledge of web services. I
haven't ever tried to use a web service through a proxy. I'm assuming
that there is something wrong with your proxy settings? I
unfortuantely don't have a proxy server to try your code against, so I
have no way of helping here. Hopefully, someone will be able to help
you further with this issue.

--
Tom Shelton
>
Tom,
>
I don't think the proxy server si the issue, because i've tried it also
from home, with no proxy server and i receive the same error message.
>
Did it work for you ?
>
Thanks,
>
Ed
Well - it worked in that I don't receive an error with the code I
originally posted. All I get back is valid = false. I checked the VAT
on the eropa site and it also says it is invalid. So, to be honest
unless I have a known valid VAT, I have know way of really knowing if
it worked or not... I was hoping you could take my code, and insert a
known good VAT (one that validates on the website) and see what you get
back.

--
Tom Shelton


Tom,

Excuse me a lot, you were right. I made a mistake in my code. It works
perfectly, exactly what i needed !!!!!!!!

Thanks for your great help !!!!
Thanks,

Ed
Great! I am happy to be of service.

--
Tom Shelton

Aug 30 '06 #14

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
528
by: PatrickSA | last post by:
Hi, Am new to web services, so apologies for the basic nature of the question - and apologies in advance if this is the wrong newsgroup. We're building a new web service and I'm looking around for documentation on a number of issues, including versioning of web service interfaces... I've spent the last few hours looking through books, Google, MSDN and surprisingly I have found little or nothing that explains/shows how to practically...
0
1785
by: David | last post by:
My "question" is on WebServices. How can i know that a sevice is available ?. I know there is the onserviceavailable property that enable a function when the WebService behavior got WSDL. But what if the server never respond ? how can i know the service is really unavaible and will never respond ? i have func1
4
2947
by: Joe | last post by:
I'm hosting my web service on a Windows 2003 box which is remotely located. When trying to add a web reference to a C# project I get an error message 'There was an error downloading 'http://mydomain.com:port/webservice.asmx' The operation has timed-out (I've tried with and without using a separate port for the service) The weird thing is the page does show up on the left side of the screen listing the available methods but the Add...
8
7192
by: Marc | last post by:
Hi! I'm calling a web service using C# and a wrapper class generated by wsdl tool. The web service specification contains some nillable parameters which types are Value Types in .NET (long, int, Decimal, ....) and I must to send them as null, and not their default value. It is possible? Is there any trick to succeed it? Thanks in advance,
3
5075
by: Jerome Cohen | last post by:
AI am trying to call a third-party web service. this service expects an XML fragment that contains the request plus other parameter. adding the web reference created the syntax below(reference.vb). I changed the data type for the structure that contains the XML data from the default "String" to "xml.xmldocument" to enable easy filling of the data. my client code creates an XML document class, fills the data using standard xml dom...
1
4271
by: sun_hcl | last post by:
I am using windows RMS software which is based on .NET Web Service. Well it provides lot of functionality exposed in form of Web SERVICES. I want to know whether i can override the web service. The source code of the web service is not available i am not aware of the methods provided by Web Service. So the basic Query is 1. How to know the methods exposed by some web service.
3
3148
by: GT | last post by:
I have a .NET client that consumes an Axis web service. A change was made recently to the AXIS web service, and ever since then my .NET proxy class has been throwing an InvalidCastException. The proxy class was auto-generated by Visual Studio from WSDL provided by people who provide the Axis service, and I have not modified it (except to add code for a build that includes a SOAP trace). The only difference I see in the messages is that...
1
2010
by: Nestor | last post by:
Hello all, I'm begining in the web services world and I've reading about how to invoke them using javascript from Mozilla browser (version 2.0 in my case). I found a very interesting example here: http://www.mozilla.org/projects/webservices/examples/babelfish-wsdl/index.html The problem I have is this: When I try to adapt the invokation on the
5
2563
by: cj | last post by:
Back some time ago I was playing with a little app in VB 2005 that used a google web service to get search results. I was rebuilding this app in 2008 today. I added the web service http://api.google.com/googlesearch.wsdl and then down in the code I was typing Dim myGoogle As New Google.GoogleSearchService only to find GoogleSearchService was no longer a method. I looked on google for documentation and it appears they no longer offer...
0
2843
by: =?ISO-8859-1?Q?Jan_Thom=E4?= | last post by:
Hi, I've been trying like a madman to make my WSDL work with .net, but it seems I am out of luck. Whenever I add a service reference to Visual C#, the code gets generated fine, however all operations miss their parameters, which is very weird. I have stripped down the WSDL to an example of a singe simple function. Before I post all the WSDL, here is what I tried. I loaded the WSDL using the "add service reference" function. I got code...
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10101
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9906
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7456
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6712
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2850
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.