UPS 地址街道级别验证
这可能是一个非常普遍的问题,但有人很幸运地使用了 UPS 街道级验证 API 吗?我研究了其中的部分内容:http://www. codeproject.com/KB/aspnet/Benz_CPE.aspx?msg=3658759&display=Mobile
这是: https://www.ups.com/upsdeveloperkit/downloadresource?loc=en_US
UPS 对其自己的示例代码没有太大帮助。即使在获得访问密钥后,他们的样本仍坚持提供的状态无效的样本数据(即使具有测试环境可接受的状态)。寻找更多线索。
This may be a very generalized question but had anyone has much luck with utilizing the UPS Street-level validation API? I have studied portions of this: http://www.codeproject.com/KB/aspnet/Benz_CPE.aspx?msg=3658759&display=Mobile
And this:
https://www.ups.com/upsdeveloperkit/downloadresource?loc=en_US
UPS has not been very helpful with their own sample code. Even after obtaining an access key, their sample insists sample data (even with the test-environment-acceptable states) that the state provided is invalid. Looking for more leads.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
UPS 通知我,C# 示例配置为“城市化”,仅适用于波多黎各。我修改了代码如下:
虽然我现在可以验证我的凭据,但我无法生成多个结果,而且我不确定它是否正在进行任何验证,因为即使我输入了虚假地址,我也会收到以下信息
:代码1
响应状态 描述 成功
当我遇到问题时,我将发布另一个问题。到那时,这个问题就有了答案。
UPS informed me that the C# sample is configured for "Urbanization" which is only appropriate in Puerto Rico. I modified the code as follows:
Although I can now validate my credentials, I cannot produce multiple results and I'm not sure it's doing any validation at all considering how even if I put in a bogus address, I receive the following:
Response Status Code 1
Response Status Description Success
When I get to that point in my problem, I'll post another question. Until then, this question is answered.
您收到的成功响应是针对 Web 服务调用的。现在,您需要查看可能的地址或“CandidateType”(UPS 对象)。
层次结构响应应类似于以下内容:
如果您有多个候选地址,您将收到一组候选类型对象。确保如果您只收到一种候选类型,请验证它不是一系列地址(如果您不包含地址的特定数字部分,则可能会得到响应。
希望它有帮助,花了我几个小时弄清楚这个
The successful response you received is for the web service call. Now, you need to look into the possible addresses or 'CandidateType' (UPS Object).
The hierarchy response should look similar to this:
If you have more than one candidate address you will receive an array of Candidate Type objects. Make sure that if you only receive one Candidate Type, verify it is not a range of addresses (which is possible to get as a response if you do not include the specific number part of an address.
Hope it helps, took me a couple hours to figure this one out
我查看了 UPS 街道级 API。我所有的搜索都没有弄清楚他们从哪里获取数据,直到我真正联系到 UPS 的开发人员,他告诉我他们的数据直接来自 USPS 地址数据库,并添加了一些他们自己的内部指标。由于 UPS 根据您的使用量对如何使用其数据进行限制(仅允许您通过其服务运送),因此使用相同的 USPS 数据但不受限制可能是有意义的。这通常可以从第三方 USPS 数据提供商处获得。您将无法下载该国家/地区所有地址的完整列表(由于隐私法),但您将能够使用 API(无限制)来执行地址验证。
为了充分披露,我是 SmartyStreets 的创始人,这是一家进行街道地址验证的公司。
I have looked at the UPS street level API. All of my searching around didn't clarify for me where they get their data until I actually reached a developer at UPS that informed me that their data comes directly from the USPS address database augmented with a few internal metrics of their own. Since UPS has restrictions on how you can use their data (which only allow you to ship with their service) depending on your usage volume, it might make sense to use the same USPS data but without restrictions. This is typically available from third-party USPS data providers. You won't be able to download a complete list of all the addresses in the country (because of privacy laws), but you will be able to use an API (without restrictions) to perform address verification.
In the interest of full disclosure, I am the founder of SmartyStreets, a company that does street address verification.
您还可以使用 http://www.verifythisaddress.com 这是一项 WCF 服务,可让您检索地址从 USPS 以及 250 多个国家/地区返回。尽管正如其他人所说,它很昂贵。我曾尝试实施 USPS,但是当我输入公寓楼的地址时,我收到一条成功消息,但它应该抛出一个错误,提示缺少套房范围。如果 UPS 未通过验证,我对是否进行验证有些犹豫。如果你无法获得正确的地址,那就达不到目的了。使用 USPS 服务或第三方(如上面的链接)。
You can also use http://www.verifythisaddress.com which is a WCF service that allows you to retrieve an address back from the USPS as well as over 250 countries. It is expensive though as other have stated. I have tried implementing USPS however when I entered an address of an apartment building I received a success message but it should have thrown an error that a suite range was missing. I have some hesitation on UPS validation if it doesn't validate. It defeats the purpose if you can't get the right address. Go with USPS services or a third party like the link above.