lib/g4s_client.rb in g4s_client-0.1.4 vs lib/g4s_client.rb in g4s_client-0.1.6
- old
+ new
@@ -1,22 +1,25 @@
+# soap headers are put on the driver, and not changed per request in soap4r. this page offers a workaround:
+# http://emphaticsolutions.com/2008/05/06/soap-headers-per-request-in-ruby.html
#puts "REQUIRING: #{Dir[__FILE__]}"
[ "g4s/shipping/default",
"g4s/shipping/defaultDriver",
"g4s/shipping/defaultMappingRegistry",
- #"g4s/shipping/IPSShippingClient",
"g4s/tracking/default",
"g4s/tracking/defaultDriver",
- #"g4s/tracking/IPSTrackingClient",
"g4s/tracking/defaultMappingRegistry",
"g4s/utilities/default",
"g4s/utilities/defaultDriver",
- #"g4s/utilities/IPSUtilitiesClient",
"g4s/utilities/defaultMappingRegistry",
"g4s/g4s",
- "g4s/g4si_auth_header",
+ "g4s/insured_ship",
+ "g4s/headers/custom_header",
+ "g4s/headers/g4si_auth_header",
+ "g4s/headers/shipment_request_header",
+ "g4s/headers/g4s_namespace_filter",
"version"].each{|f| require f}
module G4sClient
CONFIG = YAML.load( ENV['G4S_CONFIG'] || File.read(Rails.root + 'config' + 'g4s.yml') )
@@ -29,15 +32,15 @@
@service.headerhandler << G4SIAuthHeader.new(auth.username, auth.password, auth.accessKey) # Add the Authentication to the handler
end
end
class ShippingTest < G4sClient::Shipping
- def initialize; super("https://wsuat.g4si.com/IPSutilities.asmx"); end
+ def initialize; super("https://wsuat.g4si.com/IPSshipping.asmx"); end
def auth; @authentication ||= G4SIAuthentication.new(CONFIG['test']['username'], CONFIG['test']['password'], CONFIG['test']['access_key']); end #TODO: dry
end
class ShippingLive < G4sClient::Shipping
- def initialize; super("https://ws.g4si.com/IPSutilities.asmx"); end
+ def initialize; super("https://ws.g4si.com/IPSshipping.asmx"); end
def auth; @authentication ||= G4SIAuthentication.new(CONFIG['live']['username'], CONFIG['live']['password'], CONFIG['live']['access_key']); end
end
\ No newline at end of file