Welcome to the "trac"-ing site of soap4r!
[soap4r] [httpclient] [openpgp4u] [pkcs1] [logger] [csv] [vtr]

Changeset 1613

Show
Ignore:
Timestamp:
09/11/05 22:33:47 (3 years ago)
Author:
nahi
Message:

updated a client script with the newer version made by Johan. Thanks!

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/sample/wsdl/googleAdwords/client.rb

    r1503 r1613  
     1# To generate default.rb, do like this; 
     2# % wsdl2ruby.rb --wsdl "https://adwords.google.com/api/adwords/v2/CampaignService?WSDL" --classdef --force 
     3 
    14require 'soap/wsdlDriver' 
    25require 'soap/header/simplehandler' 
    3  
    4 wsdl = 'https://adwords.google.com/api/adwords/v2/CampaignService?WSDL' 
     6require 'default' 
    57 
    68class HeaderHandler < SOAP::Header::SimpleHandler 
     
    1214 
    1315  def on_simple_outbound 
    14     {@tag => @value} 
     16    @value 
    1517  end 
    1618end 
    1719 
    18 # To generate deafult.rb, do like this; 
    19 # % wsdl2ruby.rb --wsdl "https://adwords.google.com/api/adwords/v2/CampaignService?WSDL" --classdef --force 
    20 require 'default' 
     20wsdl = 'https://adwords.google.com/api/adwords/v2/CampaignService?WSDL' 
    2121 
    22 # I don't have an account of AdWords so the following code is not tested. 
    23 # Please tell me (nahi@ruby-lang.org) if you will get good/bad result in 
    24 # communicating with AdWords Server... 
    25 drv = SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver 
    26 drv.headerhandler << HeaderHandler.new('email', 'nakahiro@gmail.com') 
    27 drv.headerhandler << HeaderHandler.new('useragent', 'test') 
    28 p drv.getCampaign(GetCampaign.new(123)) 
     22client = SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver 
     23 
     24client.wiredump_dev = STDOUT  # Log high-level activity 
     25client.wiredump_file_base = "log"  # Log SOAP request and response 
     26 
     27# My Client Center manager account 
     28client.headerhandler << HeaderHandler.new('email', 'email@example.com') 
     29 
     30client.headerhandler << HeaderHandler.new('password', 'mypassword') 
     31client.headerhandler << HeaderHandler.new('useragent', 'soap4r test') 
     32client.headerhandler << HeaderHandler.new('token', 'XYZ1234567890') 
     33 
     34# (Optional) Any client account you manage 
     35client.headerhandler << HeaderHandler.new('clientEmail', 'abc@mail.com') 
     36 
     37camplist = client.call("getAllAdWordsCampaigns", 
     38  GetAllAdWordsCampaigns.new(123)) 
     39 
     40p camplist