如何使用这项服务? WSDL可用 [英] How to use this service ??? WSDL available

查看:57
本文介绍了如何使用这项服务? WSDL可用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,


我的网络服务有问题。我只是想通过国家代码和增值税数量来验证增值税

的数量。返回值应该类似于

它是有效的和/或它注册的名称。


要做到这一点,我可以访问以下位置的网络服务:
http://ec.europa.eu/taxation_customs...i/checkVatPort


WSDL文件也可用:
http://ec.europa.eu/taxation_customs...ckVatPort?wsdl


我的问题是如何才能得到结果我想。有人可以通过提供请求的小模块帮助我




我已经右键单击Web引用并添加了
http://ec.europa.eu/taxation_customs...ckVatPort? wsdl ,但

当我想使用checkvat(国家,增值税)时,它会使用其他3个字段并且

返回类型似乎是日期。


我的理解是我只需要使用2个参数(通过XML?),

并检索字符串值(XML?)


我只需要类似

returnvalue = doRequest(国家,增值税)。有效

名称= returnvalue.Name

有效= returnvalue.valid

等.....

感谢您的帮助。


问候,


Edje

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(country,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(country,VAT).valid
Name = returnvalue.Name
Valid = returnvalue.valid
etc.....
Thanks for all your help.

Regards,

Edje

推荐答案

Ed ********* @ gmail.com 写道:
Ed*********@gmail.com wrote:

我的问题是如何才能得到我想要的结果。有人可以通过提供请求的小模块帮助我


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



一旦你添加了网络参考,就可以用

方法或子方式做这种事情:


Dim ws As New WindowsApplication1.eu.europa.ec.checkVatService

Dim results As Date


result = ws。 checkVat(US,20,True,sample,address)


您提到的Web服务至少有两种方法:checkVatService

和checkVatServiceAsync。后者只查找两个输入

参数,但它没有返回值。前者返回一个值

(日期),但需要五个输入参数(将显示在

智能感知中)。


我不太了解这个网络服务,说明那些

参数中的值是有效的,但我可以告诉你我的例子中的值

以上是正确的数据类型,但会导致错误,所以很明显

它们有问题。


但是如果你知道传入的正确值范围,你应该

能够得到有效的回复(约会)。


一点点。


adm

Once you''ve added the web reference, you can do this sort of thing in a
method or sub:

Dim ws As New WindowsApplication1.eu.europa.ec.checkVatService
Dim result As Date

result = ws.checkVat("US", "20", True, "sample", "address")

The web service you mentioned has at least two methods: checkVatService
and checkVatServiceAsync. The latter is only looking for two input
parameters, but it doesn''t return a value. The former returns a value
(a date), but expects five input parameters (which will show up in
Intellisense).

I don''t know enough about this webservice to say what values in those
parameters are valid, but I can tell you that the values in my example
above are the right data type but cause an error, so obviously
something is wrong with them.

But if you know the right range of values to pass in, you should be
able to get a valid response (a date) back.

hth a little bit.

adm


adm写道:
adm wrote:

我不太了解这个web服务说明那些

参数中的值是有效的,但是我可以告诉你,我的例子中的值

是正确的数据类型但是会导致错误,很明显

他们有问题。
I don''t know enough about this webservice to say what values in those
parameters are valid, but I can tell you that the values in my example
above are the right data type but cause an error, so obviously
something is wrong with them.



好​​的,我稍微查看了增值税号码,这样我就能更好地理解

Web服务期望的值。我在上面传递的值

不正确:web方法期待(至少)两个

字符串,而不是字符串和数字。


我将我的代码更改为:


ws.checkVat(" CZ"," 991231123")


但是我收到了{INVALID_INPUT}错误。


当我在PHP中运行等效代码时,似乎工作正常,即

那里没有抛出错误,我得到一个数组,其中传递给服务的值为




这让我相信SOAP服务是不接受来自.NET客户端的
参数,就像我们习惯于使用基于.NET的Web服务看到

一样。因此,这些参数可能需要以不同的方式呈现给服务。如果有人在

中通过了复杂的专业知识。非.NET Web服务的参数,也许他们可以使用(简单?)解决方案来接受


Ok, I looked into VAT numbers a little bit so I could better understand
what kinds of values the web service is expecting. The values I passed
in above are not right: the web method is expecting (at least) two
strings, not a string and a number.

I changed my code to:

ws.checkVat("CZ", "991231123")

But I am getting an {INVALID_INPUT} error back.

When I run equivalent code in PHP, it seems to work fine, that is,
there is no error thrown, and I get an array back with the values I
passed to the service.

This leads me to believe that the SOAP service is not accepting
parameters from the .NET client in the way that we are used to seeing
with .NET-based web services. So maybe these parameters need to be
presented to the service differently. If someone has some expertise in
passing "complex" parameters to non-.NET web services, maybe they can
chime in with the (simple?) solution.



Ed*********@gmail.com 写道:

你好,


我的网络服务有问题。我只是想通过国家代码和增值税数量来验证增值税

的数量。返回值应该类似于

它是有效的和/或它注册的名称。


要做到这一点,我可以访问以下位置的网络服务:
http://ec.europa.eu/taxation_customs...i/checkVatPort


WSDL文件也可用:
http://ec.europa.eu/taxation_customs...ckVatPort?wsdl


我的问题是如何才能得到结果我想。有人可以通过提供请求的小模块帮助我




我已经右键单击Web引用并添加了
http://ec.europa.eu/taxation_customs...ckVatPort? wsdl ,但

当我想使用checkvat(国家,增值税)时,它会使用其他3个字段并且

返回类型似乎是日期。


我的理解是我只需要使用2个参数(通过XML?),

并检索字符串值(XML?)


我只需要类似

returnvalue = doRequest(国家,增值税)。有效

名称= returnvalue.Name

有效= returnvalue.valid

等.....


感谢您的帮助。


此致,


Edje
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(country,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(country,VAT).valid
Name = returnvalue.Name
Valid = returnvalue.valid
etc.....
Thanks for all your help.

Regards,

Edje



期权严格开启

选项明确开启


进口系统

进口控制台Application9.eu.europa.ec

模块模块1


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,

名称,地址)


如果有效则

Console.WriteLine(名称)

Console.WriteLine(地址)

Console.WriteLine(currentDate)

Else

Console.WriteLine(" invalid vat")

结束如果

结束子


结束模块


我现在不是一个有效的增值税,所以我真的不能测试它。我刚收到

返回有效= false。我将它导入C#,它显示

参数:


DateTime checkVat(ref string countryCode,ref string vatNumber,out

bool有效,输出字符串名称,输出字符串地址)


在C#中,这意味着该方法将填写out参数,并且

你必须提供参考参数。在c#中,这意味着您必须首先启动
,并且必须将其保存为变量。通过为您创建临时值,VB.NET将允许您通过它来逃避它。但是,你可以看看我在上面的代码中声明了所有这些值....所以,基于

C#代码我假设是VB .NET代码实际上有效吗?


-

Tom Shelton

Option Strict On
Option Explicit On

Imports System
Imports ConsoleApplication9.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.WriteLine(name)
Console.WriteLine(address)
Console.WriteLine(currentDate)
Else
Console.WriteLine("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


这篇关于如何使用这项服务? WSDL可用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆