-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The property 'address' is not defined for this Trash #11
Comments
I went through some code and thought I could resolve it by simply making a minor tweak and using standardized_address[:address] instead:
But now I am running into a different error:
Guessing they have made some changes to the API between v12 and the current v23? |
Have you tried setting the endpoint to v12? Like this: config.endpoint = "https://swsim.testing.stamps.com/swsim/swsimv12.asmx" (Within the configure block) |
We are getting the same error using any/all versions including 12. We are able to standardize and address and perform a get rates, but when we try to create a label with that information, it blows up on us giving us the same error as above. Thoughts? |
Can you post your config (omit sensitive values)? |
I am having the same problem. I can assist as well. I'm guessing that the wsdl is out of date and we need to update the data in types.rb. I can provide you with the latest wsdl, reflecting v24, not v12. |
From what I understand, the error also occurs with v12 of the wsdl? |
I cannot test v12 for some reason. I have a brand new stamps.com integration_id and it seems I only have access to v24. When I change to v12, I get a login error. |
Here is my current setup:
Here is the error I get:
|
ok, so I've updated my code to reflect the same format as darnavo's Stamps.create method and here is my response, converted to yaml format: :errors:
|
If I comment out the tracking_number = true, here is the error I get: <script src="https://gist.github.com/3717971.js"> </script> |
what error ^^ ? |
sorry, here it is... ---
:errors:
- !ruby/string
str: ! 'Invalid SOAP message due to XML Schema validation failure. The element ''CreateIndicium''
in namespace ''http://stamps.com/xml/namespace/2012/05/swsim/swsimv24'' has invalid
child element ''Rate'' in namespace ''http://stamps.com/xml/namespace/2012/05/swsim/swsimv24''.
List of possible elements expected: ''IntegratorTxID'' in namespace ''http://stamps.com/xml/namespace/2012/05/swsim/swsimv24''.'
attributes: {}
:valid?: false |
yes, same thing for me as well. |
When I comment out the "Rate" attribute, I get an error complaining about the "From" field. |
I don't know if it helps, but my only guess is that you are using outdated wsdl data or something is up with mapping.rb. If I was more experienced with wsdl and soap technology, I would be of better help. |
I have found a ruby gem called wasabi that can consume a wsdl file. It may be worthwhile using something like that so that we can add an option to load up a wsdl file for the corresponding version of the namespace and endpoint URL's I was able to load up the stamps.com wsdl using wasabi successfully, in addition to being able to see the output of the wsdl in yaml format using the .to_yaml call (requiring the yaml gem). |
I've tried modifying request.rb to use the wsdl file and I still get the same error. Here is my modification: def request(web_method, params, raw=false)
client = Savon::Client.new do |wsdl, http|
#wsdl.endpoint = self.endpoint
#wsdl.namespace = self.namespace
wsdl.document = "swsimv24.wsdl"
end |
I contacted stamps.com support and this was their feedback:
|
Ok, so I added a transaction_id puts "creating stamp"
stamp = Stamps.create!(
:transaction_id => 'blah',
:memo => 'Thanks for shopping with us!',
:tracking_number => true,
:rate => rates.first,
:to => to_address[:address],
:from => from_address[:address]
)
and hear is the new output in yaml format:
```yaml
---
:errors:
- !ruby/string
str: ! 'Deprecated Method Input: Web method deprecated for this specific use from
interface version [22] onwards'
attributes: {}
:valid?: false |
So I added transaction_id to Stamps.create! in the configuration I pasted above:
and now I get this error message:
Which means it may have worked, but I may be requesting an unsupported service. I will play around a bit more. |
Ok, I've got it working I believe with the right :service_type puts "getting rate quote"
rates = Stamps.get_rates(
:from_zip_code => '90291',
:to_zip_code => '20500',
:weight_lb => '0.5',
:service_type => "US-PP",
:ship_date => '2012-09-14'
)
puts "creating stamp"
stamp = Stamps.create!(
:transaction_id => 'blah',
:tracking_number => true,
:rate => rates.first,
:to => to_address[:address],
:from => from_address[:address]
)
Here is the output in yaml format, which I think is something I have to get stamps.com to fix:
```yaml
creating stamp
---
:errors:
- !ruby/string
str: Insufficient Postage
attributes: {}
:valid?: false |
Nice, indeed it looks like it is working. What did you do to get around the "The property 'address' is not defined" error? |
To get around the "The property 'address' is not defined", I had to use the below format, where to_address and from_address are return values from the Stamps.clean_address call. Here is what I'm using in the Stamps.create! call:
|
I don't know if it's making a difference, but I'm not using self.endpoint and self.namespace anymore. I'm loading the full wsdl file when invoking/instantiating Savon::Client.new... I'm setting wsdl.document to the location of the wsdl on my server. |
No, it does not matter. When I remove the code to load the wsdl and revert back to using self.endpoint and self.namespace, it works fine. So it appears we don't need to load the full wsdl at this point. |
You shouldn't have to run the :from address through Stamps.clean_address. Do you know if you just use the Stamps.clean_address on the :to address will it work? |
I did that originally from your documentation. I imagine that what ever object is returned by from_address[:address] call seems to be what works. All you'd need to do is figure out what object is returned form that and recreate the format, and I'm sure you wouldn't need to clean the from address. |
I see. Thanks for your help with this. |
How do I use AddOnV2?? I want to add this addon to a get rate call: US-A-DC US-A-DC is a delivery confirmation addon. Thanks! On Thu, Sep 13, 2012 at 7:07 PM, Matt Sears [email protected]:
|
Add ons go in the :rate hash of the stamp. Something like this.... stamp = Stamps.create!({
:sample => true,
:transaction_id => "1234567890ABCDEFG",
:tracking_number => true,
:rotation => 90,
:rate => {
:from_zip_code => '45440',
:to_zip_code => '45458',
:weight_oz => '1.8',
:ship_date => Date.today.strftime('%Y-%m-%d'),
:package_type => 'Package',
:service_type => 'US-FC',
:cod_value => 10.00,
:add_ons => {
:add_on => [
{ :type => 'US-A-COD' },
{ :type => 'US-A-DC' }
]
}
}
... |
How do you deal with the 'Insufficient Postage' error? |
@mark-d-holmberg That usually means you need to add funds to your stamps.com account. |
@mattsears Thank you. I am now trying to do the service type of 'US-PM' for US priority mail, but when I call the create! method I get the following error back
Any ideas? |
you have to add either signature confirmation or delivery confirmation to On Thu, Nov 29, 2012 at 9:02 AM, Mark Holmberg [email protected]:
|
i tried providing signature confirmation or delivery confirmation to priority mail but still same error.......... "Untrackable label is not supported for priority mail class." Any fixes? Could it be bug at their end because till yesterday it was working fine.. |
@mr-rick How did you go about fixing the error: I'm running into the same problem. Thanks! |
Running into a similar issue to another that has been reported but different property (and newer version of the WSDL)
This is happening when I run the Stamps.create! action. Here is the output I am getting:
SOAP response (status 200):
NoMethodError: The property 'address' is not defined for this Trash.
'>>from /Users/ayb/.rvm/gems/ruby-1.9.2-p290@stack/gems/hashie-1.0.0/lib/hashie/trash.rb:50:in
property_exists?' from /Users/ayb/.rvm/gems/ruby-1.9.2-p290@stack/gems/hashie-1.0.0/lib/hashie/trash.rb:35:in
[]='from /Users/ayb/.rvm/gems/ruby-1.9.2-p290@stack/gems/hashie-1.0.0/lib/hashie/dash.rb:83:in
block in initialize' from /Users/ayb/.rvm/gems/ruby-1.9.2-p290@stack/gems/hashie-1.0.0/lib/hashie/dash.rb:82:in
each_pair'from /Users/ayb/.rvm/gems/ruby-1.9.2-p290@stack/gems/hashie-1.0.0/lib/hashie/dash.rb:82:in
initialize' from /Users/ayb/.rvm/gems/ruby-1.9.2-p290@stack/gems/stamps-0.3.0/lib/stamps/mapping.rb:126:in
new'from /Users/ayb/.rvm/gems/ruby-1.9.2-p290@stack/gems/stamps-0.3.0/lib/stamps/mapping.rb:126:in
to=' from /Users/ayb/.rvm/gems/ruby-1.9.2-p290@stack/gems/hashie-1.0.0/lib/hashie/trash.rb:34:in
[]='from /Users/ayb/.rvm/gems/ruby-1.9.2-p290@stack/gems/hashie-1.0.0/lib/hashie/dash.rb:83:in
block in initialize' from /Users/ayb/.rvm/gems/ruby-1.9.2-p290@stack/gems/hashie-1.0.0/lib/hashie/dash.rb:82:in
each_pair'from /Users/ayb/.rvm/gems/ruby-1.9.2-p290@stack/gems/hashie-1.0.0/lib/hashie/dash.rb:82:in
initialize' from /Users/ayb/.rvm/gems/ruby-1.9.2-p290@stack/gems/stamps-0.3.0/lib/stamps/client/stamp.rb:32:in
new'from /Users/ayb/.rvm/gems/ruby-1.9.2-p290@stack/gems/stamps-0.3.0/lib/stamps/client/stamp.rb:32:in
create!' from /Users/ayb/.rvm/gems/ruby-1.9.2-p290@stack/gems/stamps-0.3.0/lib/stamps.rb:25:in
method_missing'from (irb):28
from /Users/ayb/.rvm/gems/ruby-1.9.2-p290@stack/gems/railties-3.1.7/lib/rails/commands/console.rb:45:in
start' from /Users/ayb/.rvm/gems/ruby-1.9.2-p290@stack/gems/railties-3.1.7/lib/rails/commands/console.rb:8:in
start'from /Users/ayb/.rvm/gems/ruby-1.9.2-p290@stack/gems/railties-3.1.7/lib/rails/commands.rb:40:in
<top (required)>' from script/rails:6:in
require'from script/rails:6:in `
The text was updated successfully, but these errors were encountered: