在USPS地址验证API授权失败 [英] Authorization failure in USPS Address verification API

查看:1053
本文介绍了在USPS地址验证API授权失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

只有我已注册 USPS ,提供美国地址验证API 。我使用下面的代码来获取 XML响应



但不幸的是,回应说:


授权失败用户'xxxxxxxxx'无权使用API​​ Verify.USPSCOM :: DoAuth。


我缺少一些东西?



代码:

  void IsValidAddress b $ b {
string USPS =http://production.shippingapis.com/ShippingAPITest.dll?API=Verify&XML=<AddressValidateRequest%20USERID='xxxxxxx'> ;<Address ID ='1 '>< / Address>< / Address1>< / Address1>< / Address2> 8 Wildwood Drive< / Address2>< City> Old Lyme< / City>< State> CT< / State>< Zip5> 06371< / Zip5> ;< Zip4>< / Zip4>< / Address>< / AddressValidateRequest>;
WebClient wsClient = new WebClient();

byte [] responseData = wsClient.DownloadData(USPS);

string response = string.Empty;

foreach(responseData中的字节项)
{
//这将返回xml响应
response + =(char)item;
}
string result = response;
Response.Write(result);
}

请参阅:如何验证USPS上的地址



请注意用户ID 是USPS服务提供商发行的我的个人用户ID。


<为解决此错误,我们需要调用USPS并通过向USPS发出注册ID来请求验证,并且首先您可以将邮件发送到USPS作为反馈这个问题。


Just i have a Registered with USPS which provides the US Address Validation API. I am using the following code to get the XML Response.

But, unfortunately the Response says:

Authorization Failure User 'xxxxxxxxx' is not authorized to use API Verify.USPSCOM::DoAuth.

Do i missing something?

Code:

void IsValidAddress()
{
    string USPS = "http://production.shippingapis.com/ShippingAPITest.dll?API=Verify&XML=<AddressValidateRequest%20USERID='xxxxxxx'><Address ID='1'><Address1></Address1><Address2>8 Wildwood Drive</Address2><City>Old Lyme</City><State>CT</State><Zip5>06371</Zip5><Zip4></Zip4></Address></AddressValidateRequest>";
    WebClient wsClient = new WebClient();

    byte[] responseData = wsClient.DownloadData(USPS);

    string response = string.Empty;

    foreach (byte item in responseData)
    {
        //this will return the xml response
        response += (char)item;
    }
    string result = response;
    Response.Write(result);
}

Please see: How to Validate Address on USPS

Note: the User ID is my personal User ID that is issued by USPS Service Provider.

解决方案

To Resolve this error we need to call the USPS and ask for Verification by issuing the Registered ID with USPS and also first you can send Mail to USPS as a Feedback for this issue.

这篇关于在USPS地址验证API授权失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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