Git Product home page Git Product logo

Comments (37)

ayb avatar ayb commented on July 28, 2024

I went through some code and thought I could resolve it by simply making a minor tweak and using standardized_address[:address] instead:

 stamp = Stamps.create!(
     :tracking_number => true,
     :rate          => rates.first,
     :to            => standardized_address[:address],
     :from => {
     :full_name   => 'Littlelines',
     :address1    => '50 Chestnut Street',
     :address2    => 'Suite 234',
     :city        => 'Beavervcreek',
     :state       => 'OH',
     :zip_code    => '45440'
   },
   :memo => 'Thanks for shopping with us!'
)

But now I am running into a different error:

 {:errors=>["Invalid SOAP message due to XML Schema validation failure. The element 'CreateIndicium' in namespace 'http://stamps.com/xml/namespace/2012/04/swsim/swsimv23' has invalid child element 'TrackingNumber' in namespace 'http://stamps.com/xml/namespace/2012/04/swsim/swsimv23'. List of possible elements expected: 'IntegratorTxID' in namespace 'http://stamps.com/xml/namespace/2012/04/swsim/swsimv23'."], :valid?=>false}

Guessing they have made some changes to the API between v12 and the current v23?

from stamps.

mattsears avatar mattsears commented on July 28, 2024

Have you tried setting the endpoint to v12? Like this:

config.endpoint = "https://swsim.testing.stamps.com/swsim/swsimv12.asmx"

(Within the configure block)

from stamps.

git-odi avatar git-odi commented on July 28, 2024

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?

from stamps.

mattsears avatar mattsears commented on July 28, 2024

Can you post your config (omit sensitive values)?

from stamps.

mr-rick avatar mr-rick commented on July 28, 2024

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 stamps.

mattsears avatar mattsears commented on July 28, 2024

From what I understand, the error also occurs with v12 of the wsdl?

from stamps.

mr-rick avatar mr-rick commented on July 28, 2024

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.

from stamps.

git-odi avatar git-odi commented on July 28, 2024

Here is my current setup:

Stamps.configure do |config|
    config.integration_id = 'ID'
    config.username       = 'USERNAME'
    config.password       = 'PASSWORD'
    config.raise_errors   = true
    config.endpoint       = 'https://swsim.testing.stamps.com/swsim/swsimv12.asmx'
  end
    from_address = Stamps.clean_address(
      :address => {
        :full_name => 'Chipotle',
        :address1  => '801 Congress Avenue',
        :city      => 'Austin',
        :state     => 'TX',
        :zip_code  => '78701'
    })
    
    to_address = Stamps.clean_address(
      :address => {
        :full_name   => 'Freebirds',
        :address1    => '515 South Congress Avenue',
        :city        => 'Austin',
        :state       => 'TX',
        :zip_code    => '78704'
    })
  
    # send one burrito
    rates = Stamps.get_rates(
      :from_zip_code => '78701',
      :to_zip_code   => '78704',
      :weight_lb     => '0.5',
      :ship_date     => '2012-09-14'
    )
  
    stamp = Stamps.create!(
        :tracking_number  => true,
        :rate             => rates.first,
        :to               => to_address[:address],
        :from             => from_address[:address],
        :memo             => 'Thanks for shopping with us!'
    )

Here is the error I get:

(soap:Client) Invalid SOAP message due to XML Schema validation failure. The element 'CreateIndicium' in namespace 'http://stamps.com/xml/namespace/2010/11/swsim/swsimv12' has invalid child element 'TrackingNumber' in namespace 'http://stamps.com/xml/namespace/2010/11/swsim/swsimv12'. List of possible elements expected: 'IntegratorTxID' in namespace 'http://stamps.com/xml/namespace/2010/11/swsim/swsimv12'.

from stamps.

mr-rick avatar mr-rick commented on July 28, 2024

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:

from stamps.

mr-rick avatar mr-rick commented on July 28, 2024

If I comment out the tracking_number = true, here is the error I get:

<script src="https://gist.github.com/3717971.js"> </script>

from stamps.

git-odi avatar git-odi commented on July 28, 2024

what error ^^ ?

from stamps.

mr-rick avatar mr-rick commented on July 28, 2024

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

from stamps.

git-odi avatar git-odi commented on July 28, 2024

yes, same thing for me as well.

from stamps.

mr-rick avatar mr-rick commented on July 28, 2024

When I comment out the "Rate" attribute, I get an error complaining about the "From" field.

from stamps.

mr-rick avatar mr-rick commented on July 28, 2024

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.

from stamps.

mr-rick avatar mr-rick commented on July 28, 2024

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).

from stamps.

mr-rick avatar mr-rick commented on July 28, 2024

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

from stamps.

mr-rick avatar mr-rick commented on July 28, 2024

I contacted stamps.com support and this was their feedback:


You are not including the "IntegratorTxID" in your CreateIndicium request. That element would go just prior to TrackingNumber and is a unique identifier you create.

from stamps.

mr-rick avatar mr-rick commented on July 28, 2024

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

from stamps.

git-odi avatar git-odi commented on July 28, 2024

So I added transaction_id to Stamps.create! in the configuration I pasted above:


stamp = Stamps.create!(
    :transaction_id   => "193193",
    :tracking_number  => true,
    :rate             => rates.first,
    :to               => to_address[:address],
    :from             => from_address[:address],
    :memo             => 'Thanks for shopping with us!'
)

and now I get this error message:

(soap:Server) Memo is not supported for First Class Mail with Letter or Postcard.

Which means it may have worked, but I may be requesting an unsupported service. I will play around a bit more.

from stamps.

mr-rick avatar mr-rick commented on July 28, 2024

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

from stamps.

mattsears avatar mattsears commented on July 28, 2024

Nice, indeed it looks like it is working. What did you do to get around the "The property 'address' is not defined" error?

from stamps.

mr-rick avatar mr-rick commented on July 28, 2024

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:

:to            => to_address[:address],
:from          => from_address[:address]

from stamps.

mr-rick avatar mr-rick commented on July 28, 2024

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.

from stamps.

mr-rick avatar mr-rick commented on July 28, 2024

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.

from stamps.

mattsears avatar mattsears commented on July 28, 2024

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?

from stamps.

mr-rick avatar mr-rick commented on July 28, 2024

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.

from stamps.

mattsears avatar mattsears commented on July 28, 2024

I see. Thanks for your help with this.

from stamps.

mr-rick avatar mr-rick commented on July 28, 2024

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]:

I see. Thanks for your help with this.


Reply to this email directly or view it on GitHubhttps://github.com//issues/11#issuecomment-8549899.

from stamps.

mattsears avatar mattsears commented on July 28, 2024

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' }
        ]
      }
    }
 ...

from stamps.

mark-d-holmberg avatar mark-d-holmberg commented on July 28, 2024

How do you deal with the 'Insufficient Postage' error?

from stamps.

mattsears avatar mattsears commented on July 28, 2024

@mark-d-holmberg That usually means you need to add funds to your stamps.com account.

from stamps.

mark-d-holmberg avatar mark-d-holmberg commented on July 28, 2024

@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

Untrackable label is not supported for priority mail class.

Any ideas?

from stamps.

mr-rick avatar mr-rick commented on July 28, 2024

you have to add either signature confirmation or delivery confirmation to
priority mail. you get tracking numbers for either one of these services.

On Thu, Nov 29, 2012 at 9:02 AM, Mark Holmberg [email protected]:

@mattsears https://github.com/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

Untrackable label is not supported for priority mail class.

Any ideas?


Reply to this email directly or view it on GitHubhttps://github.com//issues/11#issuecomment-10856514.

from stamps.

puzzell avatar puzzell commented on July 28, 2024

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..

from stamps.

commodity avatar commodity commented on July 28, 2024

@mr-rick How did you go about fixing the error:
Savon::SOAP::Fault: (soap:Server) Deprecated Method Input: Web method deprecated for this specific use from interface version [22] onwards

I'm running into the same problem. Thanks!

from stamps.

Amitdada avatar Amitdada commented on July 28, 2024

Deprecated Method Input: Web method deprecated for this specific use from interface version [22] onwards in asp.net c# while printing shipping label so what i have to do now?
image

from stamps.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.