FedEx:测试帐户身份验证失败

发布于 2024-12-11 14:16:25 字数 1524 浏览 0 评论 0原文

我正在尝试将 FedEx 与我的应用程序集成。我创建了一个测试帐户。 当我发送 RateRequest 时,我收到响应“身份验证失败”(代码为 1000)。 我使用 v10 的 Fedex Rate 服务。对于 SOAP,我使用 Savon ruby​​ gem。

这是我使用的代码:

require 'rubygems'
require 'savon'

TEST_URL = 'https://wsbeta.fedex.com:443/web-services/rate'

client = Savon::Client.new do
  wsdl.document = File.expand_path("../rate_wsdl.xml", __FILE__)
  wsdl.endpoint = TEST_URL
end

client.request "RateRequest" do
  soap.body = {
    'WebAuthenticationDetail' => {'Key' => KEY, 'Password' => PASSWORD},
    'ClientDetail' => {'AccountNumber' => ACCOUNT_NUMBER, 'MeterNumber' => METER_NUMBER},
    'RequestedShipment' => {
      'PackagingType' => 'FODEX_BOX',
      'Shipper' => 
        {'Address' => {'PostalCode' => '90210', 'CountryCode' => 'US', 'Residential' => 'true'}
      },
      'Recipient' => 
        {'Address' => {'PostalCode' => 'KIP 1J1', 'CountryCode' => 'CA', 'Residential' => 'true'}
      },
      'RateRequestTypes' => 'ACCOUNT',
      'PackageCount' => '1',
      'RequestedPackages' => {
        'Weight' => {'Units' => 'LB', 'Value' => '7.5'},
        'Dimensions' => {'Length' => '15', 'Width' => '10', 'Height' => '5', 'Units' => 'IN'}
      }
      #'LabelSpecification' => ''
    }
  }
end

我在谷歌上搜索了很多相关信息。有些人也有同样的问题。人们说这可能是由于缺乏地址验证权限而引起的,但我找不到如何禁用它。 我确信所有凭据都正确(帐号、电表编号、密钥、密码)。 我还尝试了“https://wsbeta.fedex.com:443/web-service”作为端点 URL。

I'm trying to integrate FedEx with my application. I created a test account.
When I send RateRequest I got a response Authentication Failed (code is 1000).
I use v10 of Fedex Rate service. For SOAP I use Savon ruby gem.

Here is code I use:

require 'rubygems'
require 'savon'

TEST_URL = 'https://wsbeta.fedex.com:443/web-services/rate'

client = Savon::Client.new do
  wsdl.document = File.expand_path("../rate_wsdl.xml", __FILE__)
  wsdl.endpoint = TEST_URL
end

client.request "RateRequest" do
  soap.body = {
    'WebAuthenticationDetail' => {'Key' => KEY, 'Password' => PASSWORD},
    'ClientDetail' => {'AccountNumber' => ACCOUNT_NUMBER, 'MeterNumber' => METER_NUMBER},
    'RequestedShipment' => {
      'PackagingType' => 'FODEX_BOX',
      'Shipper' => 
        {'Address' => {'PostalCode' => '90210', 'CountryCode' => 'US', 'Residential' => 'true'}
      },
      'Recipient' => 
        {'Address' => {'PostalCode' => 'KIP 1J1', 'CountryCode' => 'CA', 'Residential' => 'true'}
      },
      'RateRequestTypes' => 'ACCOUNT',
      'PackageCount' => '1',
      'RequestedPackages' => {
        'Weight' => {'Units' => 'LB', 'Value' => '7.5'},
        'Dimensions' => {'Length' => '15', 'Width' => '10', 'Height' => '5', 'Units' => 'IN'}
      }
      #'LabelSpecification' => ''
    }
  }
end

I googled a lot about it. Some people had the same problem. People say it can be caused because of lack of permission of address validation, but I can't find how I can disable it if so.
I am sure that all credentials are OK (account number, meter number, key, password).
Also I tried "https://wsbeta.fedex.com:443/web-service" for endpoint url as well.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

情栀口红 2024-12-18 14:16:25

想通了是错误的。我发送了无效的 SOAP 请求。感谢 SOAPUI 工具,它帮助我验证了我的请求。

Figured out of was wrong. I sent invalid SOAP request. Thanks to SOAPUI tool, it helped me to validate my request.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文