oass 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +4 -0
- data/Gemfile +10 -0
- data/README.md +33 -0
- data/Rakefile +2 -0
- data/lib/oass.rb +24 -0
- data/lib/oass/campaign.rb +35 -0
- data/lib/oass/client.rb +59 -0
- data/lib/oass/creative.rb +50 -0
- data/lib/oass/errors.rb +4 -0
- data/lib/oass/version.rb +3 -0
- data/oass.gemspec +25 -0
- data/spec/fixtures/vcr_cassettes/Oass_Client/_read_campaign.yml +240 -0
- data/spec/fixtures/vcr_cassettes/Oass_Client/_read_creative.yml +160 -0
- data/spec/fixtures/vcr_cassettes/Oass_Client/_request.yml +291 -0
- data/spec/oass/client_spec.rb +161 -0
- data/spec/oass/configuration_spec.rb +11 -0
- data/spec/spec_helper.rb +11 -0
- metadata +136 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
# O_ass_
|
2
|
+
Oass is a library to help you to interact with OAS and its bizarre soap API.
|
3
|
+
|
4
|
+
## Installation
|
5
|
+
gem install oass
|
6
|
+
|
7
|
+
## Configuration
|
8
|
+
Add global configurations directly to the Oass module:
|
9
|
+
|
10
|
+
Oass.configure do |config|
|
11
|
+
config.endpoint = "The wsdl endpoint"
|
12
|
+
config.account = "Your OAS account"
|
13
|
+
config.username = "LOL"
|
14
|
+
config.password = "WUT"
|
15
|
+
end
|
16
|
+
|
17
|
+
You can override any settings when you instantiate a new client
|
18
|
+
|
19
|
+
client = Oass::Client.new :username => "Other", :password => "Secret"
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
client = Oass::Client.new
|
23
|
+
campaign = client.read_campaign("campaign_id")
|
24
|
+
|
25
|
+
You can also make requests that are not yet natively implemented
|
26
|
+
|
27
|
+
client.request "Campaign" do |xml|
|
28
|
+
xml.Campaign(:action => "list") do
|
29
|
+
xml.SearchCriteria do
|
30
|
+
xml.Status "L"
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
data/Rakefile
ADDED
data/lib/oass.rb
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'active_support/core_ext/module/attribute_accessors'
|
2
|
+
require 'active_support/core_ext/hash/reverse_merge'
|
3
|
+
require 'savon'
|
4
|
+
require 'oass/errors'
|
5
|
+
|
6
|
+
module Oass
|
7
|
+
autoload :Client, "oass/client"
|
8
|
+
autoload :Campaign, "oass/campaign"
|
9
|
+
autoload :Creative, "oass/creative"
|
10
|
+
|
11
|
+
mattr_accessor :endpoint
|
12
|
+
@@endpoint = "https://training7.247realmedia.com//oasapi/OaxApi?wsdl"
|
13
|
+
|
14
|
+
mattr_accessor :account
|
15
|
+
@@account = "OasDefault"
|
16
|
+
|
17
|
+
mattr_accessor :username
|
18
|
+
|
19
|
+
mattr_accessor :password
|
20
|
+
|
21
|
+
def configure
|
22
|
+
yield self
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
module Oass
|
2
|
+
module Campaign
|
3
|
+
def read_campaign(id)
|
4
|
+
request "Campaign" do |xml|
|
5
|
+
xml.Campaign(:action => "read") do
|
6
|
+
xml.Overview { xml.Id id }
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
def create_campaign(attributes)
|
12
|
+
request "Campaign" do |xml|
|
13
|
+
xml.Campaign(:action => "add") do
|
14
|
+
xml.Overview do
|
15
|
+
# Yeah... the attributes must be in the right order =/
|
16
|
+
xml.Id attributes[:id]
|
17
|
+
xml.AdvertiserId attributes[:advertiser_id]
|
18
|
+
xml.Name attributes[:name]
|
19
|
+
xml.AgencyId attributes[:agency_id]
|
20
|
+
xml.Description attributes[:description]
|
21
|
+
xml.CampaignManager attributes[:campaign_manager]
|
22
|
+
xml.ProductId attributes[:product_id]
|
23
|
+
xml.ExternalUsers do
|
24
|
+
attributes[:external_users].each do |user_id|
|
25
|
+
xml.UserId user_id
|
26
|
+
end
|
27
|
+
end if attributes[:external_users]
|
28
|
+
xml.InternalQuickReport attributes[:internal_quick_report]
|
29
|
+
xml.ExternalQuickReport attributes[:external_quick_report]
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
data/lib/oass/client.rb
ADDED
@@ -0,0 +1,59 @@
|
|
1
|
+
module Oass
|
2
|
+
class Client
|
3
|
+
attr_accessor :endpoint, :account, :username, :password
|
4
|
+
|
5
|
+
include Campaign
|
6
|
+
include Creative
|
7
|
+
|
8
|
+
def initialize(options = {})
|
9
|
+
options.reverse_merge! :endpoint => Oass.endpoint,
|
10
|
+
:account => Oass.account,
|
11
|
+
:username => Oass.username,
|
12
|
+
:password => Oass.password
|
13
|
+
|
14
|
+
options.each_pair do |key, value|
|
15
|
+
send "#{key}=", value
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
def request(method)
|
20
|
+
body = Nokogiri::XML::Builder.new(:encoding => "UTF-8") do |xml|
|
21
|
+
xml.AdXML do
|
22
|
+
xml.Request(:type => method) do
|
23
|
+
yield xml
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
response = Savon::Client.new(endpoint).request :n1, :oas_xml_request, :"xmlns:n1" => "http://api.oas.tfsm.com/" do
|
29
|
+
soap.body = {
|
30
|
+
"String_1" => account,
|
31
|
+
"String_2" => username,
|
32
|
+
"String_3" => password,
|
33
|
+
"String_4" => body.to_xml
|
34
|
+
}
|
35
|
+
end
|
36
|
+
|
37
|
+
parse(response)
|
38
|
+
end
|
39
|
+
|
40
|
+
protected
|
41
|
+
|
42
|
+
def parse(response)
|
43
|
+
response = Nokogiri::XML.parse(response.to_hash[:oas_xml_request_response][:result])
|
44
|
+
raise_errors(response)
|
45
|
+
response.css("AdXML > Response > *").first
|
46
|
+
end
|
47
|
+
|
48
|
+
def raise_errors(response)
|
49
|
+
return if (error = response.css("Exception")).empty?
|
50
|
+
|
51
|
+
case error.attribute("errorCode").value.to_i
|
52
|
+
when 545
|
53
|
+
raise Oass::NotFoundError.new error.first.content
|
54
|
+
else
|
55
|
+
raise Oass::OASError.new error.first.content
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
module Oass
|
2
|
+
module Creative
|
3
|
+
def read_creative(campaign_id, id)
|
4
|
+
request "Creative" do |xml|
|
5
|
+
xml.Creative(:action => "read") do
|
6
|
+
xml.CampaignId campaign_id
|
7
|
+
xml.Id id
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
def create_creative(attributes)
|
13
|
+
request "Creative" do |xml|
|
14
|
+
xml.Creative(:action => "add") do
|
15
|
+
xml.CampaignId attributes[:campaign_id]
|
16
|
+
xml.Id attributes[:id]
|
17
|
+
xml.Name attributes[:name]
|
18
|
+
xml.Description attributes[:description]
|
19
|
+
xml.ClickUrl attributes[:click_url]
|
20
|
+
xml.Positions do
|
21
|
+
attributes[:positions].each do |position|
|
22
|
+
xml.Position position
|
23
|
+
end
|
24
|
+
end
|
25
|
+
xml.CreativeTypesId attributes[:creative_types_id]
|
26
|
+
xml.RedirectUrl attributes[:redirect_url]
|
27
|
+
xml.Display attributes[:display]
|
28
|
+
xml.Height attributes[:height]
|
29
|
+
xml.Width attributes[:width]
|
30
|
+
xml.TargetWindow attributes[:target_window]
|
31
|
+
xml.AltText attributes[:alt_text]
|
32
|
+
xml.DiscountImpressions attributes[:discount_impressions]
|
33
|
+
xml.StartDate attributes[:start_date]
|
34
|
+
xml.EndDate attributes[:end_date]
|
35
|
+
xml.Weight attributes[:weight]
|
36
|
+
xml.ExpireImmediately attributes[:expire_immediately]
|
37
|
+
xml.NoCache attributes[:no_cache]
|
38
|
+
xml.ExtraHTML attributes[:extra_html]
|
39
|
+
xml.ExtraText attributes[:extra_text]
|
40
|
+
xml.BrowserV do
|
41
|
+
attributes[:browser_versions].each do |version|
|
42
|
+
xml.Code version
|
43
|
+
end
|
44
|
+
end
|
45
|
+
xml.SequenceNo attributes[:sequence_number]
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
data/lib/oass/errors.rb
ADDED
data/lib/oass/version.rb
ADDED
data/oass.gemspec
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "oass/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "oass"
|
7
|
+
s.version = Oass::VERSION
|
8
|
+
s.platform = Gem::Platform::RUBY
|
9
|
+
s.authors = ["Rodrigo Navarro"]
|
10
|
+
s.email = ["navarro@manapot.com.br"]
|
11
|
+
s.homepage = ""
|
12
|
+
s.summary = %q{Funny API to access OAS hellish soap interface}
|
13
|
+
s.description = %q{Help you to communicate with the corporate advertisers world!}
|
14
|
+
|
15
|
+
s.rubyforge_project = "oass"
|
16
|
+
|
17
|
+
s.files = `git ls-files`.split("\n")
|
18
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
19
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
20
|
+
s.require_paths = ["lib"]
|
21
|
+
|
22
|
+
s.add_dependency "savon", "~> 0.9.2"
|
23
|
+
s.add_dependency "nokogiri", "~> 1.4.4"
|
24
|
+
s.add_dependency "activesupport", "~> 3.0.0"
|
25
|
+
end
|
@@ -0,0 +1,240 @@
|
|
1
|
+
---
|
2
|
+
- !ruby/struct:VCR::HTTPInteraction
|
3
|
+
request: !ruby/struct:VCR::Request
|
4
|
+
method: :get
|
5
|
+
uri: https://training7.247realmedia.com:443//oasapi/OaxApi?wsdl
|
6
|
+
body:
|
7
|
+
headers:
|
8
|
+
response: !ruby/struct:VCR::Response
|
9
|
+
status: !ruby/struct:VCR::ResponseStatus
|
10
|
+
code: 200
|
11
|
+
message: OK
|
12
|
+
headers:
|
13
|
+
etag:
|
14
|
+
- "\"44e617-674-48c8d0448cd40\""
|
15
|
+
p3p:
|
16
|
+
- CP="NON NID PSAa PSDa OUR IND UNI COM NAV STA",policyref="/w3c/p3p.xml"
|
17
|
+
last-modified:
|
18
|
+
- Thu, 29 Jul 2010 20:59:57 GMT
|
19
|
+
content-type:
|
20
|
+
- text/xml
|
21
|
+
server:
|
22
|
+
- Apache/2.2.3 (Red Hat)
|
23
|
+
date:
|
24
|
+
- Wed, 25 May 2011 22:50:14 GMT
|
25
|
+
content-length:
|
26
|
+
- "1652"
|
27
|
+
accept-ranges:
|
28
|
+
- bytes
|
29
|
+
body: |
|
30
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
31
|
+
<definitions name="OaxApiService" targetNamespace="http://api.oas.tfsm.com/" xmlns:tns="http://api.oas.tfsm.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns="http://schemas.xmlsoap.org/wsdl/">
|
32
|
+
<types>
|
33
|
+
</types>
|
34
|
+
<message name="OaxApi_OasXmlRequestResponse">
|
35
|
+
<part name="result" type="xsd:string">
|
36
|
+
</part>
|
37
|
+
</message>
|
38
|
+
<message name="OaxApi_OasXmlRequest">
|
39
|
+
<part name="String_1" type="xsd:string">
|
40
|
+
|
41
|
+
</part>
|
42
|
+
<part name="String_2" type="xsd:string">
|
43
|
+
</part>
|
44
|
+
<part name="String_3" type="xsd:string">
|
45
|
+
</part>
|
46
|
+
<part name="String_4" type="xsd:string">
|
47
|
+
</part>
|
48
|
+
</message>
|
49
|
+
<portType name="OaxApi">
|
50
|
+
|
51
|
+
<operation name="OasXmlRequest" parameterOrder="String_1 String_2 String_3 String_4">
|
52
|
+
<input message="tns:OaxApi_OasXmlRequest">
|
53
|
+
</input>
|
54
|
+
<output message="tns:OaxApi_OasXmlRequestResponse">
|
55
|
+
</output>
|
56
|
+
</operation>
|
57
|
+
</portType>
|
58
|
+
<binding name="OaxApiBinding" type="tns:OaxApi">
|
59
|
+
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
|
60
|
+
|
61
|
+
<operation name="OasXmlRequest">
|
62
|
+
<soap:operation soapAction=""/>
|
63
|
+
<input>
|
64
|
+
<soap:body use="literal" namespace="http://api.oas.tfsm.com/"/>
|
65
|
+
</input>
|
66
|
+
<output>
|
67
|
+
<soap:body use="literal" namespace="http://api.oas.tfsm.com/"/>
|
68
|
+
</output>
|
69
|
+
</operation>
|
70
|
+
|
71
|
+
</binding>
|
72
|
+
<service name="OaxApiService">
|
73
|
+
<port name="OaxApiPort" binding="tns:OaxApiBinding">
|
74
|
+
<soap:address location="https://training7.247realmedia.com:443/oasapi/OaxApi"/>
|
75
|
+
</port>
|
76
|
+
</service>
|
77
|
+
</definitions>
|
78
|
+
|
79
|
+
http_version: "1.1"
|
80
|
+
- !ruby/struct:VCR::HTTPInteraction
|
81
|
+
request: !ruby/struct:VCR::Request
|
82
|
+
method: :post
|
83
|
+
uri: https://training7.247realmedia.com:443/oasapi/OaxApi
|
84
|
+
body: |-
|
85
|
+
<?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:n1="http://api.oas.tfsm.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Body><n1:OasXmlRequest xmlns:n1="http://api.oas.tfsm.com/"><String_1>Abril</String_1><String_2>dev_abril</String_2><String_3>d3v@p1SgpD</String_3><String_4><?xml version="1.0" encoding="UTF-8"?>
|
86
|
+
<AdXML>
|
87
|
+
<Request type="Campaign">
|
88
|
+
<Campaign action="read">
|
89
|
+
<Overview>
|
90
|
+
<Id>abx_oferta3</Id>
|
91
|
+
</Overview>
|
92
|
+
</Campaign>
|
93
|
+
</Request>
|
94
|
+
</AdXML>
|
95
|
+
</String_4></n1:OasXmlRequest></env:Body></env:Envelope>
|
96
|
+
headers:
|
97
|
+
content-type:
|
98
|
+
- text/xml;charset=UTF-8
|
99
|
+
soapaction:
|
100
|
+
- "\"OasXmlRequest\""
|
101
|
+
response: !ruby/struct:VCR::Response
|
102
|
+
status: !ruby/struct:VCR::ResponseStatus
|
103
|
+
code: 200
|
104
|
+
message: OK
|
105
|
+
headers:
|
106
|
+
x-powered-by:
|
107
|
+
- Servlet 2.5; JBoss-5.0/JBossWeb-2.1
|
108
|
+
p3p:
|
109
|
+
- CP="NON NID PSAa PSDa OUR IND UNI COM NAV STA",policyref="/w3c/p3p.xml"
|
110
|
+
content-type:
|
111
|
+
- text/xml;charset=UTF-8
|
112
|
+
via:
|
113
|
+
- 1.1 training7.247realmedia.com
|
114
|
+
server:
|
115
|
+
- Apache-Coyote/1.1
|
116
|
+
date:
|
117
|
+
- Wed, 25 May 2011 22:50:15 GMT
|
118
|
+
transfer-encoding:
|
119
|
+
- chunked
|
120
|
+
body: |-
|
121
|
+
<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><ns1:OasXmlRequestResponse xmlns:ns1="http://api.oas.tfsm.com/"><result><?xml version='1.0'?>
|
122
|
+
<AdXML>
|
123
|
+
|
124
|
+
<Response>
|
125
|
+
<Campaign>
|
126
|
+
<Overview>
|
127
|
+
<Id>abx_oferta3</Id>
|
128
|
+
<AdvertiserId>abx_anunciante</AdvertiserId>
|
129
|
+
<Name>abx_oferta2</Name>
|
130
|
+
<AgencyId>vitrine</AgencyId>
|
131
|
+
<Description/>
|
132
|
+
<ProductId>vitrine</ProductId>
|
133
|
+
<Status>L</Status>
|
134
|
+
<CampaignGroups>
|
135
|
+
<CampaignGroupId>abx_anunciante</CampaignGroupId>
|
136
|
+
</CampaignGroups>
|
137
|
+
<CompetitiveCategories/>
|
138
|
+
<ExternalUsers/>
|
139
|
+
<InternalQuickReport>to-date</InternalQuickReport>
|
140
|
+
<ExternalQuickReport>short</ExternalQuickReport>
|
141
|
+
<WhoCreated>vitrine_api</WhoCreated>
|
142
|
+
<WhenCreated>2011-04-11 16:15:32</WhenCreated>
|
143
|
+
<WhoModified>interface_abril</WhoModified>
|
144
|
+
<WhenModified>2011-05-25 11:54:39</WhenModified>
|
145
|
+
</Overview>
|
146
|
+
<Schedule>
|
147
|
+
<Impressions>0</Impressions>
|
148
|
+
<Clicks>0</Clicks>
|
149
|
+
<Uniques>0</Uniques>
|
150
|
+
<Weight>0</Weight>
|
151
|
+
<PriorityLevel>5</PriorityLevel>
|
152
|
+
<Completion>S</Completion>
|
153
|
+
<StartDate>2011-04-11</StartDate>
|
154
|
+
<StartTime>00:00</StartTime>
|
155
|
+
<EndDate></EndDate>
|
156
|
+
<EndTime></EndTime>
|
157
|
+
<Reach>O</Reach>
|
158
|
+
<DailyImp>0</DailyImp>
|
159
|
+
<DailyGoals/>
|
160
|
+
<DailyClicks>0</DailyClicks>
|
161
|
+
<DailyUniq>0</DailyUniq>
|
162
|
+
<SmoothOrAsap>S</SmoothOrAsap>
|
163
|
+
<ImpOverrun>0</ImpOverrun>
|
164
|
+
<CompanionPositions/>
|
165
|
+
<StrictCompanions>N</StrictCompanions>
|
166
|
+
<PrimaryFrequency>
|
167
|
+
<ImpPerVisitor>0</ImpPerVisitor>
|
168
|
+
<ClickPerVisitor>0</ClickPerVisitor>
|
169
|
+
<FreqScope>0</FreqScope>
|
170
|
+
</PrimaryFrequency>
|
171
|
+
<SecondaryFrequency>
|
172
|
+
<ImpPerVisitor>0</ImpPerVisitor>
|
173
|
+
<FreqScope>0</FreqScope>
|
174
|
+
</SecondaryFrequency>
|
175
|
+
<HourOfDay/>
|
176
|
+
<DayOfWeek/>
|
177
|
+
<UserTimeZone>N</UserTimeZone>
|
178
|
+
<Sections/>
|
179
|
+
<CampaignPauses/>
|
180
|
+
</Schedule>
|
181
|
+
<Pages/>
|
182
|
+
<Target>
|
183
|
+
<ExcludeTargets>N</ExcludeTargets>
|
184
|
+
<TopLevelDomain/>
|
185
|
+
<Domain></Domain>
|
186
|
+
<Bandwidth/>
|
187
|
+
<Continent/>
|
188
|
+
<Country/>
|
189
|
+
<State/>
|
190
|
+
<AreaCode/>
|
191
|
+
<Msa/>
|
192
|
+
<Dma/>
|
193
|
+
<City/>
|
194
|
+
<Zones/>
|
195
|
+
<Zip/>
|
196
|
+
<ClaritasSegments/>
|
197
|
+
<Omniture/>
|
198
|
+
<Os/>
|
199
|
+
<Browser/>
|
200
|
+
<BrowserV/>
|
201
|
+
<SearchType>A</SearchType>
|
202
|
+
<SearchTerm></SearchTerm>
|
203
|
+
<Cookie/>
|
204
|
+
<AgeFrom></AgeFrom>
|
205
|
+
<AgeTo></AgeTo>
|
206
|
+
<Gender>
|
207
|
+
<Code>E</Code>
|
208
|
+
</Gender>
|
209
|
+
<IncomeFrom></IncomeFrom>
|
210
|
+
<IncomeTo></IncomeTo>
|
211
|
+
<SubscriberCode></SubscriberCode>
|
212
|
+
<PreferenceFlags></PreferenceFlags>
|
213
|
+
<Cluster/>
|
214
|
+
</Target>
|
215
|
+
<Exclude>
|
216
|
+
<Sites/>
|
217
|
+
<Pages/>
|
218
|
+
</Exclude>
|
219
|
+
<Billing>
|
220
|
+
<ContractedRevenue></ContractedRevenue>
|
221
|
+
<BillOffContracted>N</BillOffContracted>
|
222
|
+
<Cpm>0.0000</Cpm>
|
223
|
+
<Cpc>0.0000</Cpc>
|
224
|
+
<Cpa></Cpa>
|
225
|
+
<FlatRate></FlatRate>
|
226
|
+
<Tax></Tax>
|
227
|
+
<AgencyCommission>0.00</AgencyCommission>
|
228
|
+
<PaymentMethod>C</PaymentMethod>
|
229
|
+
<PurchaseOrder/>
|
230
|
+
<SalesRepresentative/>
|
231
|
+
<CommissionPercent>0.0000</CommissionPercent>
|
232
|
+
<Notes/>
|
233
|
+
<IsYieldManaged>N</IsYieldManaged>
|
234
|
+
<BillTo>G</BillTo>
|
235
|
+
<Currency/>
|
236
|
+
</Billing>
|
237
|
+
</Campaign>
|
238
|
+
</Response>
|
239
|
+
</AdXML></result></ns1:OasXmlRequestResponse></soapenv:Body></soapenv:Envelope>
|
240
|
+
http_version: "1.1"
|
@@ -0,0 +1,160 @@
|
|
1
|
+
---
|
2
|
+
- !ruby/struct:VCR::HTTPInteraction
|
3
|
+
request: !ruby/struct:VCR::Request
|
4
|
+
method: :get
|
5
|
+
uri: https://training7.247realmedia.com:443//oasapi/OaxApi?wsdl
|
6
|
+
body:
|
7
|
+
headers:
|
8
|
+
response: !ruby/struct:VCR::Response
|
9
|
+
status: !ruby/struct:VCR::ResponseStatus
|
10
|
+
code: 200
|
11
|
+
message: OK
|
12
|
+
headers:
|
13
|
+
etag:
|
14
|
+
- "\"44e617-674-48c8d0448cd40\""
|
15
|
+
p3p:
|
16
|
+
- CP="NON NID PSAa PSDa OUR IND UNI COM NAV STA",policyref="/w3c/p3p.xml"
|
17
|
+
last-modified:
|
18
|
+
- Thu, 29 Jul 2010 20:59:57 GMT
|
19
|
+
content-type:
|
20
|
+
- text/xml
|
21
|
+
server:
|
22
|
+
- Apache/2.2.3 (Red Hat)
|
23
|
+
date:
|
24
|
+
- Wed, 25 May 2011 22:50:16 GMT
|
25
|
+
content-length:
|
26
|
+
- "1652"
|
27
|
+
accept-ranges:
|
28
|
+
- bytes
|
29
|
+
body: |
|
30
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
31
|
+
<definitions name="OaxApiService" targetNamespace="http://api.oas.tfsm.com/" xmlns:tns="http://api.oas.tfsm.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns="http://schemas.xmlsoap.org/wsdl/">
|
32
|
+
<types>
|
33
|
+
</types>
|
34
|
+
<message name="OaxApi_OasXmlRequestResponse">
|
35
|
+
<part name="result" type="xsd:string">
|
36
|
+
</part>
|
37
|
+
</message>
|
38
|
+
<message name="OaxApi_OasXmlRequest">
|
39
|
+
<part name="String_1" type="xsd:string">
|
40
|
+
|
41
|
+
</part>
|
42
|
+
<part name="String_2" type="xsd:string">
|
43
|
+
</part>
|
44
|
+
<part name="String_3" type="xsd:string">
|
45
|
+
</part>
|
46
|
+
<part name="String_4" type="xsd:string">
|
47
|
+
</part>
|
48
|
+
</message>
|
49
|
+
<portType name="OaxApi">
|
50
|
+
|
51
|
+
<operation name="OasXmlRequest" parameterOrder="String_1 String_2 String_3 String_4">
|
52
|
+
<input message="tns:OaxApi_OasXmlRequest">
|
53
|
+
</input>
|
54
|
+
<output message="tns:OaxApi_OasXmlRequestResponse">
|
55
|
+
</output>
|
56
|
+
</operation>
|
57
|
+
</portType>
|
58
|
+
<binding name="OaxApiBinding" type="tns:OaxApi">
|
59
|
+
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
|
60
|
+
|
61
|
+
<operation name="OasXmlRequest">
|
62
|
+
<soap:operation soapAction=""/>
|
63
|
+
<input>
|
64
|
+
<soap:body use="literal" namespace="http://api.oas.tfsm.com/"/>
|
65
|
+
</input>
|
66
|
+
<output>
|
67
|
+
<soap:body use="literal" namespace="http://api.oas.tfsm.com/"/>
|
68
|
+
</output>
|
69
|
+
</operation>
|
70
|
+
|
71
|
+
</binding>
|
72
|
+
<service name="OaxApiService">
|
73
|
+
<port name="OaxApiPort" binding="tns:OaxApiBinding">
|
74
|
+
<soap:address location="https://training7.247realmedia.com:443/oasapi/OaxApi"/>
|
75
|
+
</port>
|
76
|
+
</service>
|
77
|
+
</definitions>
|
78
|
+
|
79
|
+
http_version: "1.1"
|
80
|
+
- !ruby/struct:VCR::HTTPInteraction
|
81
|
+
request: !ruby/struct:VCR::Request
|
82
|
+
method: :post
|
83
|
+
uri: https://training7.247realmedia.com:443/oasapi/OaxApi
|
84
|
+
body: |-
|
85
|
+
<?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:n1="http://api.oas.tfsm.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Body><n1:OasXmlRequest xmlns:n1="http://api.oas.tfsm.com/"><String_1>Abril</String_1><String_2>dev_abril</String_2><String_3>d3v@p1SgpD</String_3><String_4><?xml version="1.0" encoding="UTF-8"?>
|
86
|
+
<AdXML>
|
87
|
+
<Request type="Creative">
|
88
|
+
<Creative action="read">
|
89
|
+
<CampaignId>abx_oferta3</CampaignId>
|
90
|
+
<Id>creatiewut</Id>
|
91
|
+
</Creative>
|
92
|
+
</Request>
|
93
|
+
</AdXML>
|
94
|
+
</String_4></n1:OasXmlRequest></env:Body></env:Envelope>
|
95
|
+
headers:
|
96
|
+
content-type:
|
97
|
+
- text/xml;charset=UTF-8
|
98
|
+
soapaction:
|
99
|
+
- "\"OasXmlRequest\""
|
100
|
+
response: !ruby/struct:VCR::Response
|
101
|
+
status: !ruby/struct:VCR::ResponseStatus
|
102
|
+
code: 200
|
103
|
+
message: OK
|
104
|
+
headers:
|
105
|
+
x-powered-by:
|
106
|
+
- Servlet 2.5; JBoss-5.0/JBossWeb-2.1
|
107
|
+
p3p:
|
108
|
+
- CP="NON NID PSAa PSDa OUR IND UNI COM NAV STA",policyref="/w3c/p3p.xml"
|
109
|
+
content-type:
|
110
|
+
- text/xml;charset=UTF-8
|
111
|
+
via:
|
112
|
+
- 1.1 training7.247realmedia.com
|
113
|
+
server:
|
114
|
+
- Apache-Coyote/1.1
|
115
|
+
date:
|
116
|
+
- Wed, 25 May 2011 22:50:17 GMT
|
117
|
+
transfer-encoding:
|
118
|
+
- chunked
|
119
|
+
body: |-
|
120
|
+
<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><ns1:OasXmlRequestResponse xmlns:ns1="http://api.oas.tfsm.com/"><result><?xml version='1.0'?>
|
121
|
+
<AdXML>
|
122
|
+
|
123
|
+
<Response>
|
124
|
+
<Creative>
|
125
|
+
<CampaignId>abx_oferta3</CampaignId>
|
126
|
+
<Id>creatiewut</Id>
|
127
|
+
<Name>creatiewut</Name>
|
128
|
+
<Description/>
|
129
|
+
<ClickUrl>test</ClickUrl>
|
130
|
+
<Positions>
|
131
|
+
<Position>x05</Position>
|
132
|
+
</Positions>
|
133
|
+
<CreativeTypesId>unknown_type</CreativeTypesId>
|
134
|
+
<Display>Y</Display>
|
135
|
+
<Height/>
|
136
|
+
<Width/>
|
137
|
+
<TargetWindow/>
|
138
|
+
<AltText/>
|
139
|
+
<DiscountImpressions>N</DiscountImpressions>
|
140
|
+
<StartDate/>
|
141
|
+
<StartTime></StartTime>
|
142
|
+
<EndDate/>
|
143
|
+
<EndTime></EndTime>
|
144
|
+
<Weight>10</Weight>
|
145
|
+
<ExpireImmediately>N</ExpireImmediately>
|
146
|
+
<NoCache>N</NoCache>
|
147
|
+
<ExtraHTML/>
|
148
|
+
<ExtraText/>
|
149
|
+
<RichMediaCpm>0.0</RichMediaCpm>
|
150
|
+
<BrowserV/>
|
151
|
+
<SequenceNo/>
|
152
|
+
<CountOnDownload>N</CountOnDownload>
|
153
|
+
<WhoCreated>interface_abril</WhoCreated>
|
154
|
+
<WhenCreated>2011-05-25 11:54:39</WhenCreated>
|
155
|
+
<WhoModified></WhoModified>
|
156
|
+
<WhenModified></WhenModified>
|
157
|
+
</Creative>
|
158
|
+
</Response>
|
159
|
+
</AdXML></result></ns1:OasXmlRequestResponse></soapenv:Body></soapenv:Envelope>
|
160
|
+
http_version: "1.1"
|
@@ -0,0 +1,291 @@
|
|
1
|
+
---
|
2
|
+
- !ruby/struct:VCR::HTTPInteraction
|
3
|
+
request: !ruby/struct:VCR::Request
|
4
|
+
method: :get
|
5
|
+
uri: https://training7.247realmedia.com:443//oasapi/OaxApi?wsdl
|
6
|
+
body:
|
7
|
+
headers:
|
8
|
+
response: !ruby/struct:VCR::Response
|
9
|
+
status: !ruby/struct:VCR::ResponseStatus
|
10
|
+
code: 200
|
11
|
+
message: OK
|
12
|
+
headers:
|
13
|
+
etag:
|
14
|
+
- "\"44e617-674-48c8d0448cd40\""
|
15
|
+
last-modified:
|
16
|
+
- Thu, 29 Jul 2010 20:59:57 GMT
|
17
|
+
p3p:
|
18
|
+
- CP="NON NID PSAa PSDa OUR IND UNI COM NAV STA",policyref="/w3c/p3p.xml"
|
19
|
+
content-type:
|
20
|
+
- text/xml
|
21
|
+
date:
|
22
|
+
- Wed, 25 May 2011 22:50:11 GMT
|
23
|
+
server:
|
24
|
+
- Apache/2.2.3 (Red Hat)
|
25
|
+
content-length:
|
26
|
+
- "1652"
|
27
|
+
accept-ranges:
|
28
|
+
- bytes
|
29
|
+
body: |
|
30
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
31
|
+
<definitions name="OaxApiService" targetNamespace="http://api.oas.tfsm.com/" xmlns:tns="http://api.oas.tfsm.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns="http://schemas.xmlsoap.org/wsdl/">
|
32
|
+
<types>
|
33
|
+
</types>
|
34
|
+
<message name="OaxApi_OasXmlRequestResponse">
|
35
|
+
<part name="result" type="xsd:string">
|
36
|
+
</part>
|
37
|
+
</message>
|
38
|
+
<message name="OaxApi_OasXmlRequest">
|
39
|
+
<part name="String_1" type="xsd:string">
|
40
|
+
|
41
|
+
</part>
|
42
|
+
<part name="String_2" type="xsd:string">
|
43
|
+
</part>
|
44
|
+
<part name="String_3" type="xsd:string">
|
45
|
+
</part>
|
46
|
+
<part name="String_4" type="xsd:string">
|
47
|
+
</part>
|
48
|
+
</message>
|
49
|
+
<portType name="OaxApi">
|
50
|
+
|
51
|
+
<operation name="OasXmlRequest" parameterOrder="String_1 String_2 String_3 String_4">
|
52
|
+
<input message="tns:OaxApi_OasXmlRequest">
|
53
|
+
</input>
|
54
|
+
<output message="tns:OaxApi_OasXmlRequestResponse">
|
55
|
+
</output>
|
56
|
+
</operation>
|
57
|
+
</portType>
|
58
|
+
<binding name="OaxApiBinding" type="tns:OaxApi">
|
59
|
+
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
|
60
|
+
|
61
|
+
<operation name="OasXmlRequest">
|
62
|
+
<soap:operation soapAction=""/>
|
63
|
+
<input>
|
64
|
+
<soap:body use="literal" namespace="http://api.oas.tfsm.com/"/>
|
65
|
+
</input>
|
66
|
+
<output>
|
67
|
+
<soap:body use="literal" namespace="http://api.oas.tfsm.com/"/>
|
68
|
+
</output>
|
69
|
+
</operation>
|
70
|
+
|
71
|
+
</binding>
|
72
|
+
<service name="OaxApiService">
|
73
|
+
<port name="OaxApiPort" binding="tns:OaxApiBinding">
|
74
|
+
<soap:address location="https://training7.247realmedia.com:443/oasapi/OaxApi"/>
|
75
|
+
</port>
|
76
|
+
</service>
|
77
|
+
</definitions>
|
78
|
+
|
79
|
+
http_version: "1.1"
|
80
|
+
- !ruby/struct:VCR::HTTPInteraction
|
81
|
+
request: !ruby/struct:VCR::Request
|
82
|
+
method: :post
|
83
|
+
uri: https://training7.247realmedia.com:443/oasapi/OaxApi
|
84
|
+
body: |-
|
85
|
+
<?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:n1="http://api.oas.tfsm.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Body><n1:OasXmlRequest xmlns:n1="http://api.oas.tfsm.com/"><String_1>Abril</String_1><String_2>dev_abril</String_2><String_3>d3v@p1SgpD</String_3><String_4><?xml version="1.0" encoding="UTF-8"?>
|
86
|
+
<AdXML>
|
87
|
+
<Request type="Campaign">
|
88
|
+
<Campaign action="read">
|
89
|
+
<Overview>
|
90
|
+
<Id>abx_oferta3</Id>
|
91
|
+
</Overview>
|
92
|
+
</Campaign>
|
93
|
+
</Request>
|
94
|
+
</AdXML>
|
95
|
+
</String_4></n1:OasXmlRequest></env:Body></env:Envelope>
|
96
|
+
headers:
|
97
|
+
soapaction:
|
98
|
+
- "\"OasXmlRequest\""
|
99
|
+
content-type:
|
100
|
+
- text/xml;charset=UTF-8
|
101
|
+
response: !ruby/struct:VCR::Response
|
102
|
+
status: !ruby/struct:VCR::ResponseStatus
|
103
|
+
code: 200
|
104
|
+
message: OK
|
105
|
+
headers:
|
106
|
+
x-powered-by:
|
107
|
+
- Servlet 2.5; JBoss-5.0/JBossWeb-2.1
|
108
|
+
p3p:
|
109
|
+
- CP="NON NID PSAa PSDa OUR IND UNI COM NAV STA",policyref="/w3c/p3p.xml"
|
110
|
+
via:
|
111
|
+
- 1.1 training7.247realmedia.com
|
112
|
+
content-type:
|
113
|
+
- text/xml;charset=UTF-8
|
114
|
+
date:
|
115
|
+
- Wed, 25 May 2011 22:50:12 GMT
|
116
|
+
server:
|
117
|
+
- Apache-Coyote/1.1
|
118
|
+
transfer-encoding:
|
119
|
+
- chunked
|
120
|
+
body: |-
|
121
|
+
<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><ns1:OasXmlRequestResponse xmlns:ns1="http://api.oas.tfsm.com/"><result><?xml version='1.0'?>
|
122
|
+
<AdXML>
|
123
|
+
|
124
|
+
<Response>
|
125
|
+
<Campaign>
|
126
|
+
<Overview>
|
127
|
+
<Id>abx_oferta3</Id>
|
128
|
+
<AdvertiserId>abx_anunciante</AdvertiserId>
|
129
|
+
<Name>abx_oferta2</Name>
|
130
|
+
<AgencyId>vitrine</AgencyId>
|
131
|
+
<Description/>
|
132
|
+
<ProductId>vitrine</ProductId>
|
133
|
+
<Status>L</Status>
|
134
|
+
<CampaignGroups>
|
135
|
+
<CampaignGroupId>abx_anunciante</CampaignGroupId>
|
136
|
+
</CampaignGroups>
|
137
|
+
<CompetitiveCategories/>
|
138
|
+
<ExternalUsers/>
|
139
|
+
<InternalQuickReport>to-date</InternalQuickReport>
|
140
|
+
<ExternalQuickReport>short</ExternalQuickReport>
|
141
|
+
<WhoCreated>vitrine_api</WhoCreated>
|
142
|
+
<WhenCreated>2011-04-11 16:15:32</WhenCreated>
|
143
|
+
<WhoModified>interface_abril</WhoModified>
|
144
|
+
<WhenModified>2011-05-25 11:54:39</WhenModified>
|
145
|
+
</Overview>
|
146
|
+
<Schedule>
|
147
|
+
<Impressions>0</Impressions>
|
148
|
+
<Clicks>0</Clicks>
|
149
|
+
<Uniques>0</Uniques>
|
150
|
+
<Weight>0</Weight>
|
151
|
+
<PriorityLevel>5</PriorityLevel>
|
152
|
+
<Completion>S</Completion>
|
153
|
+
<StartDate>2011-04-11</StartDate>
|
154
|
+
<StartTime>00:00</StartTime>
|
155
|
+
<EndDate></EndDate>
|
156
|
+
<EndTime></EndTime>
|
157
|
+
<Reach>O</Reach>
|
158
|
+
<DailyImp>0</DailyImp>
|
159
|
+
<DailyGoals/>
|
160
|
+
<DailyClicks>0</DailyClicks>
|
161
|
+
<DailyUniq>0</DailyUniq>
|
162
|
+
<SmoothOrAsap>S</SmoothOrAsap>
|
163
|
+
<ImpOverrun>0</ImpOverrun>
|
164
|
+
<CompanionPositions/>
|
165
|
+
<StrictCompanions>N</StrictCompanions>
|
166
|
+
<PrimaryFrequency>
|
167
|
+
<ImpPerVisitor>0</ImpPerVisitor>
|
168
|
+
<ClickPerVisitor>0</ClickPerVisitor>
|
169
|
+
<FreqScope>0</FreqScope>
|
170
|
+
</PrimaryFrequency>
|
171
|
+
<SecondaryFrequency>
|
172
|
+
<ImpPerVisitor>0</ImpPerVisitor>
|
173
|
+
<FreqScope>0</FreqScope>
|
174
|
+
</SecondaryFrequency>
|
175
|
+
<HourOfDay/>
|
176
|
+
<DayOfWeek/>
|
177
|
+
<UserTimeZone>N</UserTimeZone>
|
178
|
+
<Sections/>
|
179
|
+
<CampaignPauses/>
|
180
|
+
</Schedule>
|
181
|
+
<Pages/>
|
182
|
+
<Target>
|
183
|
+
<ExcludeTargets>N</ExcludeTargets>
|
184
|
+
<TopLevelDomain/>
|
185
|
+
<Domain></Domain>
|
186
|
+
<Bandwidth/>
|
187
|
+
<Continent/>
|
188
|
+
<Country/>
|
189
|
+
<State/>
|
190
|
+
<AreaCode/>
|
191
|
+
<Msa/>
|
192
|
+
<Dma/>
|
193
|
+
<City/>
|
194
|
+
<Zones/>
|
195
|
+
<Zip/>
|
196
|
+
<ClaritasSegments/>
|
197
|
+
<Omniture/>
|
198
|
+
<Os/>
|
199
|
+
<Browser/>
|
200
|
+
<BrowserV/>
|
201
|
+
<SearchType>A</SearchType>
|
202
|
+
<SearchTerm></SearchTerm>
|
203
|
+
<Cookie/>
|
204
|
+
<AgeFrom></AgeFrom>
|
205
|
+
<AgeTo></AgeTo>
|
206
|
+
<Gender>
|
207
|
+
<Code>E</Code>
|
208
|
+
</Gender>
|
209
|
+
<IncomeFrom></IncomeFrom>
|
210
|
+
<IncomeTo></IncomeTo>
|
211
|
+
<SubscriberCode></SubscriberCode>
|
212
|
+
<PreferenceFlags></PreferenceFlags>
|
213
|
+
<Cluster/>
|
214
|
+
</Target>
|
215
|
+
<Exclude>
|
216
|
+
<Sites/>
|
217
|
+
<Pages/>
|
218
|
+
</Exclude>
|
219
|
+
<Billing>
|
220
|
+
<ContractedRevenue></ContractedRevenue>
|
221
|
+
<BillOffContracted>N</BillOffContracted>
|
222
|
+
<Cpm>0.0000</Cpm>
|
223
|
+
<Cpc>0.0000</Cpc>
|
224
|
+
<Cpa></Cpa>
|
225
|
+
<FlatRate></FlatRate>
|
226
|
+
<Tax></Tax>
|
227
|
+
<AgencyCommission>0.00</AgencyCommission>
|
228
|
+
<PaymentMethod>C</PaymentMethod>
|
229
|
+
<PurchaseOrder/>
|
230
|
+
<SalesRepresentative/>
|
231
|
+
<CommissionPercent>0.0000</CommissionPercent>
|
232
|
+
<Notes/>
|
233
|
+
<IsYieldManaged>N</IsYieldManaged>
|
234
|
+
<BillTo>G</BillTo>
|
235
|
+
<Currency/>
|
236
|
+
</Billing>
|
237
|
+
</Campaign>
|
238
|
+
</Response>
|
239
|
+
</AdXML></result></ns1:OasXmlRequestResponse></soapenv:Body></soapenv:Envelope>
|
240
|
+
http_version: "1.1"
|
241
|
+
- !ruby/struct:VCR::HTTPInteraction
|
242
|
+
request: !ruby/struct:VCR::Request
|
243
|
+
method: :post
|
244
|
+
uri: https://training7.247realmedia.com:443/oasapi/OaxApi
|
245
|
+
body: |-
|
246
|
+
<?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:n1="http://api.oas.tfsm.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Body><n1:OasXmlRequest xmlns:n1="http://api.oas.tfsm.com/"><String_1>Abril</String_1><String_2>dev_abril</String_2><String_3>d3v@p1SgpD</String_3><String_4><?xml version="1.0" encoding="UTF-8"?>
|
247
|
+
<AdXML>
|
248
|
+
<Request type="Campaign">
|
249
|
+
<Campaign action="read">
|
250
|
+
<Overview>
|
251
|
+
<Id>invalid_id_lol</Id>
|
252
|
+
</Overview>
|
253
|
+
</Campaign>
|
254
|
+
</Request>
|
255
|
+
</AdXML>
|
256
|
+
</String_4></n1:OasXmlRequest></env:Body></env:Envelope>
|
257
|
+
headers:
|
258
|
+
content-type:
|
259
|
+
- text/xml;charset=UTF-8
|
260
|
+
soapaction:
|
261
|
+
- "\"OasXmlRequest\""
|
262
|
+
response: !ruby/struct:VCR::Response
|
263
|
+
status: !ruby/struct:VCR::ResponseStatus
|
264
|
+
code: 200
|
265
|
+
message: OK
|
266
|
+
headers:
|
267
|
+
x-powered-by:
|
268
|
+
- Servlet 2.5; JBoss-5.0/JBossWeb-2.1
|
269
|
+
p3p:
|
270
|
+
- CP="NON NID PSAa PSDa OUR IND UNI COM NAV STA",policyref="/w3c/p3p.xml"
|
271
|
+
content-type:
|
272
|
+
- text/xml;charset=UTF-8
|
273
|
+
via:
|
274
|
+
- 1.1 training7.247realmedia.com
|
275
|
+
server:
|
276
|
+
- Apache-Coyote/1.1
|
277
|
+
date:
|
278
|
+
- Wed, 25 May 2011 22:50:13 GMT
|
279
|
+
transfer-encoding:
|
280
|
+
- chunked
|
281
|
+
body: |-
|
282
|
+
<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><ns1:OasXmlRequestResponse xmlns:ns1="http://api.oas.tfsm.com/"><result><?xml version='1.0'?>
|
283
|
+
<AdXML>
|
284
|
+
|
285
|
+
<Response>
|
286
|
+
<Campaign>
|
287
|
+
<Exception errorCode='545'>Invalid CampaignId.</Exception>
|
288
|
+
</Campaign>
|
289
|
+
</Response>
|
290
|
+
</AdXML></result></ns1:OasXmlRequestResponse></soapenv:Body></soapenv:Envelope>
|
291
|
+
http_version: "1.1"
|
@@ -0,0 +1,161 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe Oass::Client do
|
4
|
+
context "configuration" do
|
5
|
+
[:endpoint, :account, :username, :password].each do |setting|
|
6
|
+
context "on initialization" do
|
7
|
+
subject { Oass::Client.new setting => "WUT" }
|
8
|
+
its(setting) { should == "WUT" }
|
9
|
+
end
|
10
|
+
|
11
|
+
context "after initialization" do
|
12
|
+
subject { Oass::Client.new }
|
13
|
+
before { subject.send("#{setting}=", "WUT") }
|
14
|
+
its(setting) { should == "WUT" }
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
describe "#request" do
|
20
|
+
use_vcr_cassette :record => :new_episodes, :match_requests_on => [:uri, :method, :body]
|
21
|
+
|
22
|
+
let(:client) { Oass::Client.new }
|
23
|
+
|
24
|
+
context "successfully" do
|
25
|
+
subject do
|
26
|
+
client.request "Campaign" do |xml|
|
27
|
+
xml.Campaign(:action => "read") do
|
28
|
+
xml.Overview { xml.Id "abx_oferta3" }
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
it "finds the right campaign" do
|
34
|
+
subject.css("Id").first.content.should == "abx_oferta3"
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
context "unsuccessfully" do
|
39
|
+
it "raises a OASError" do
|
40
|
+
expect {
|
41
|
+
client.request "Campaign" do |xml|
|
42
|
+
xml.Campaign(:action => "read") do
|
43
|
+
xml.Overview { xml.Id "invalid_id_lol" }
|
44
|
+
end
|
45
|
+
end
|
46
|
+
}.to raise_error(Oass::OASError)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
describe "#read_campaign" do
|
52
|
+
use_vcr_cassette :record => :new_episodes, :match_requests_on => [:uri, :method, :body]
|
53
|
+
|
54
|
+
let(:client) { Oass::Client.new }
|
55
|
+
|
56
|
+
context "with a valid id" do
|
57
|
+
subject { client.read_campaign("abx_oferta3") }
|
58
|
+
|
59
|
+
it "finds the right campaign" do
|
60
|
+
subject.css("Id").first.content.should == "abx_oferta3"
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
context "with an invalid id" do
|
65
|
+
it "raises a NotFoundError" do
|
66
|
+
expect { client.read_campaign("LOLWUT").to raise_error(Oass::NotFoundError) }
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
describe "#read_creative" do
|
72
|
+
use_vcr_cassette :record => :new_episodes, :match_requests_on => [:uri, :method, :body]
|
73
|
+
|
74
|
+
let(:client) { Oass::Client.new }
|
75
|
+
|
76
|
+
context "with a valid id" do
|
77
|
+
subject { client.read_creative("abx_oferta3", "creatiewut") }
|
78
|
+
|
79
|
+
it "finds the right creative" do
|
80
|
+
subject.css("Id").first.content.should == "creatiewut"
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
context "with an invalid id" do
|
85
|
+
it "raises a NotFoundError" do
|
86
|
+
expect { client.read_creative("abx_oferta3", "LOLWUT").to raise_error(Oass::NotFoundError) }
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
context "with an invalid campaign id" do
|
91
|
+
it "raises a NotFoundError" do
|
92
|
+
expect { client.read_creative("LOLWUT", "creatiewut").to raise_error(Oass::NotFoundError) }
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
describe "#create_campaign" do
|
98
|
+
use_vcr_cassette :record => :new_episodes, :match_requests_on => [:uri, :method, :body]
|
99
|
+
|
100
|
+
let(:client) { Oass::Client.new }
|
101
|
+
|
102
|
+
context "with the required attributes" do
|
103
|
+
let(:attributes) do
|
104
|
+
{
|
105
|
+
:id => "random_id_lolwut_wtf",
|
106
|
+
:name => "LOLWUT",
|
107
|
+
:advertiser_id => "bobo",
|
108
|
+
:agency_id => "unknown_agency",
|
109
|
+
:name => "LOLWUT",
|
110
|
+
:campaign_manager => "lol",
|
111
|
+
:product_id => "default-product",
|
112
|
+
}
|
113
|
+
end
|
114
|
+
|
115
|
+
subject { client.create_campaign attributes }
|
116
|
+
|
117
|
+
its(:content) { "Successfully added." }
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
121
|
+
describe "#create_criative" do
|
122
|
+
use_vcr_cassette :record => :new_episodes, :match_requests_on => [:uri, :method, :body]
|
123
|
+
|
124
|
+
let(:client) { Oass::Client.new }
|
125
|
+
|
126
|
+
context "with valid attributes" do
|
127
|
+
let(:attributes) do
|
128
|
+
{
|
129
|
+
:campaign_id => "random_id_lolwut",
|
130
|
+
:id => "I_am_so_creative_lol",
|
131
|
+
:name => "A nice name indeed",
|
132
|
+
:description => "Blabla",
|
133
|
+
:click_url => "http://lolwut.com",
|
134
|
+
:positions => %w(TopLeft BottomLeft),
|
135
|
+
:creative_types_id => "unknow_type",
|
136
|
+
:redirect_url => "http://lolwut.com",
|
137
|
+
:display => "Y",
|
138
|
+
:height => "30",
|
139
|
+
:width => "30",
|
140
|
+
:target_window => "targetwindow",
|
141
|
+
:alt_text => "Oh hai!",
|
142
|
+
:discount_impressions => "N",
|
143
|
+
:start_date => "1986-03-31",
|
144
|
+
:end_date => "2040-03-31",
|
145
|
+
:weight => "79",
|
146
|
+
:expire_immediately => "N",
|
147
|
+
:no_cache => "N",
|
148
|
+
:extra_html => "<b></b>",
|
149
|
+
:extra_text => "kthxbai",
|
150
|
+
:browser_versions => %w(explorer6 netscape7),
|
151
|
+
:sequence_number => "4"
|
152
|
+
}
|
153
|
+
|
154
|
+
end
|
155
|
+
|
156
|
+
subject { client.create_creative attributes }
|
157
|
+
|
158
|
+
its(:content) { "Successfully added." }
|
159
|
+
end
|
160
|
+
end
|
161
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe Oass do
|
4
|
+
describe ".configure" do
|
5
|
+
[:endpoint, :account, :username, :password].each do |setting|
|
6
|
+
it "allows configuration for #{setting}" do
|
7
|
+
expect { Oass.send("#{setting}=", "LOL") }.to change { Oass.send(setting) }.to("LOL")
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
data/spec/spec_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,136 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: oass
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 29
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 1
|
10
|
+
version: 0.0.1
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Rodrigo Navarro
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2011-05-25 00:00:00 -03:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
name: savon
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 63
|
30
|
+
segments:
|
31
|
+
- 0
|
32
|
+
- 9
|
33
|
+
- 2
|
34
|
+
version: 0.9.2
|
35
|
+
type: :runtime
|
36
|
+
version_requirements: *id001
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: nokogiri
|
39
|
+
prerelease: false
|
40
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
hash: 15
|
46
|
+
segments:
|
47
|
+
- 1
|
48
|
+
- 4
|
49
|
+
- 4
|
50
|
+
version: 1.4.4
|
51
|
+
type: :runtime
|
52
|
+
version_requirements: *id002
|
53
|
+
- !ruby/object:Gem::Dependency
|
54
|
+
name: activesupport
|
55
|
+
prerelease: false
|
56
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
hash: 7
|
62
|
+
segments:
|
63
|
+
- 3
|
64
|
+
- 0
|
65
|
+
- 0
|
66
|
+
version: 3.0.0
|
67
|
+
type: :runtime
|
68
|
+
version_requirements: *id003
|
69
|
+
description: Help you to communicate with the corporate advertisers world!
|
70
|
+
email:
|
71
|
+
- navarro@manapot.com.br
|
72
|
+
executables: []
|
73
|
+
|
74
|
+
extensions: []
|
75
|
+
|
76
|
+
extra_rdoc_files: []
|
77
|
+
|
78
|
+
files:
|
79
|
+
- .gitignore
|
80
|
+
- Gemfile
|
81
|
+
- README.md
|
82
|
+
- Rakefile
|
83
|
+
- lib/oass.rb
|
84
|
+
- lib/oass/campaign.rb
|
85
|
+
- lib/oass/client.rb
|
86
|
+
- lib/oass/creative.rb
|
87
|
+
- lib/oass/errors.rb
|
88
|
+
- lib/oass/version.rb
|
89
|
+
- oass.gemspec
|
90
|
+
- spec/fixtures/vcr_cassettes/Oass_Client/_read_campaign.yml
|
91
|
+
- spec/fixtures/vcr_cassettes/Oass_Client/_read_creative.yml
|
92
|
+
- spec/fixtures/vcr_cassettes/Oass_Client/_request.yml
|
93
|
+
- spec/oass/client_spec.rb
|
94
|
+
- spec/oass/configuration_spec.rb
|
95
|
+
- spec/spec_helper.rb
|
96
|
+
has_rdoc: true
|
97
|
+
homepage: ""
|
98
|
+
licenses: []
|
99
|
+
|
100
|
+
post_install_message:
|
101
|
+
rdoc_options: []
|
102
|
+
|
103
|
+
require_paths:
|
104
|
+
- lib
|
105
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
106
|
+
none: false
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
hash: 3
|
111
|
+
segments:
|
112
|
+
- 0
|
113
|
+
version: "0"
|
114
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
115
|
+
none: false
|
116
|
+
requirements:
|
117
|
+
- - ">="
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
hash: 3
|
120
|
+
segments:
|
121
|
+
- 0
|
122
|
+
version: "0"
|
123
|
+
requirements: []
|
124
|
+
|
125
|
+
rubyforge_project: oass
|
126
|
+
rubygems_version: 1.5.0
|
127
|
+
signing_key:
|
128
|
+
specification_version: 3
|
129
|
+
summary: Funny API to access OAS hellish soap interface
|
130
|
+
test_files:
|
131
|
+
- spec/fixtures/vcr_cassettes/Oass_Client/_read_campaign.yml
|
132
|
+
- spec/fixtures/vcr_cassettes/Oass_Client/_read_creative.yml
|
133
|
+
- spec/fixtures/vcr_cassettes/Oass_Client/_request.yml
|
134
|
+
- spec/oass/client_spec.rb
|
135
|
+
- spec/oass/configuration_spec.rb
|
136
|
+
- spec/spec_helper.rb
|