Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
rates error
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  8 messages - 7 new - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Brian Pokosh  
View profile  
 More options Aug 8 2009, 5:29 pm
From: Brian Pokosh <bpok...@gmail.com>
Date: Sat, 8 Aug 2009 14:29:34 -0700 (PDT)
Local: Sat, Aug 8 2009 5:29 pm
Subject: rates error
I'm getting an error when trying the fedex.rate call:

Shippinglogic::FedEx::Error: Schema validation failed for request.,
Expected element 'CountryCode@http://fedex.com/ws/rate/v6' instead of
'Residential@http://fedex.com/ws/rate/v6' here in element
Address@http://fedex.com/ws/rate/v6, and Expected element
'CountryCode@http://fedex.com/ws/rate/v6' before the end of the
content in element Address@http://fedex.com/ws/rate/v6

I'm using the example in the code:
rates = fedex.rate(
 :shipper_postal_code => "10007",
 :shipper_country => "US",
 :recipient_postal_code => "75201",
 :recipient_country_code => "US",
 :package_weight => 24,
 :package_length => 12,
 :package_width => 12,
 :package_height => 12
)

It might be a good idea to save the XML request and response so that
they can be viewed later.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ben Johnson  
View profile  
 More options Aug 8 2009, 5:36 pm
From: Ben Johnson <bjohn...@binarylogic.com>
Date: Sat, 8 Aug 2009 17:36:19 -0400
Local: Sat, Aug 8 2009 5:36 pm
Subject: Re: rates error
Hey Brian,

Use country, not country_code.

I don't do any validation on my end because that is fedex's job. More  
importantly, I dont want to keep up with their validation changes, etc  
because they don't document that.

Anyways country refers to the element they want.

Ben Johnson
Binary Logic

W: www.binarylogic.com
E: bjohn...@binarylogic.com

On Aug 8, 2009, at 5:29 PM, Brian Pokosh wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ben Johnson  
View profile  
 More options Aug 8 2009, 5:40 pm
From: Ben Johnson <bjohn...@binarylogic.com>
Date: Sat, 8 Aug 2009 17:40:14 -0400
Local: Sat, Aug 8 2009 5:40 pm
Subject: Re: rates error
Also, the response is saved in the error object

rescue Shippinglogic::FedEx::Error => e
e.response
end

Ben Johnson
Binary Logic

W: www.binarylogic.com
E: bjohn...@binarylogic.com

On Aug 8, 2009, at 5:29 PM, Brian Pokosh wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Brian Pokosh  
View profile  
 More options Aug 8 2009, 5:46 pm
From: Brian Pokosh <bpok...@gmail.com>
Date: Sat, 8 Aug 2009 14:46:37 -0700 (PDT)
Local: Sat, Aug 8 2009 5:46 pm
Subject: Re: rates error
I'm still getting the error. Here's the code I'm using, it's the same
an in your example but I removed the _code:

rates = fedex.rate(
 :shipper_postal_code => "10007",
 :shipper_country => "US",
 :recipient_postal_code => "75201",
 :recipient_country => "US",
 :package_weight => 24,
 :package_length => 12,
 :package_width => 12,
 :package_height => 12
)

Any ideas?

On Aug 8, 5:36 pm, Ben Johnson <bjohn...@binarylogic.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ben Johnson  
View profile  
 More options Aug 8 2009, 5:55 pm
From: Ben Johnson <bjohn...@binarylogic.com>
Date: Sat, 8 Aug 2009 17:55:42 -0400
Local: Sat, Aug 8 2009 5:55 pm
Subject: Re: rates error
Your request looks good to me. I just released a new version for you.  
Update to that version and do this:

begin
        # your fedex code here
rescue Shippinglogic::FedEx::Error => e
        raise e.request.inspect
end

That should show your raw request. Be sure and mask your fedex  
credentials. But that should tell us whats going on. All of my tests  
are passing and I'm currently rating packages in my app right now. So  
it's probably something dumb.

Ben Johnson
Binary Logic

W: www.binarylogic.com
E: bjohn...@binarylogic.com

On Aug 8, 2009, at 5:46 PM, Brian Pokosh wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Brian Pokosh  
View profile  
 More options Aug 8 2009, 6:38 pm
From: Brian Pokosh <bpok...@gmail.com>
Date: Sat, 8 Aug 2009 15:38:06 -0700 (PDT)
Local: Sat, Aug 8 2009 6:38 pm
Subject: Re: rates error
I haven't looked at what you changed yet, but whatever it was fixed
it. I'll do some more testing later.

Something I noticed is when I make a change to the request - say I
change the weight and call fedex.rate again - it returns the cached
result. Is it assumed that I will create a new fedex object for each
request?

On Aug 8, 5:55 pm, Ben Johnson <bjohn...@binarylogic.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ben Johnson  
View profile  
 More options Aug 8 2009, 7:23 pm
From: Ben Johnson <bjohn...@binarylogic.com>
Date: Sat, 8 Aug 2009 19:23:14 -0400
Local: Sat, Aug 8 2009 7:23 pm
Subject: Re: rates error
No, I haven't really thought about doing that, but no you should not  
have to create a new object for each request. Let me write some tests  
for that and come up with a solution. What I am trying to avoid with  
the caching is this:

rates = fedex.rate
rates.first
rates.last

The 2 last lines should not make 2 requests, but what I think I'll do  
is clear the cache if any attributes are changed.

Ben Johnson
Binary Logic

W: www.binarylogic.com
E: bjohn...@binarylogic.com

On Aug 8, 2009, at 6:38 PM, Brian Pokosh wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ben Johnson  
View profile  
 More options Aug 9 2009, 2:23 pm
From: Ben Johnson <bjohn...@binarylogic.com>
Date: Sun, 9 Aug 2009 14:23:43 -0400
Local: Sun, Aug 9 2009 2:23 pm
Subject: Re: rates error
Ok, this is fixed, just update the gem.

Ben Johnson
Binary Logic

W: www.binarylogic.com
E: bjohn...@binarylogic.com

On Aug 8, 2009, at 6:38 PM, Brian Pokosh wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic