campaign_master 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1 @@
1
+ *.gem
data/.travis.yml ADDED
@@ -0,0 +1,8 @@
1
+ language: "ruby"
2
+ script: "bundle exec rspec"
3
+ rvm:
4
+ - 1.9.2
5
+ - 1.9.3
6
+ - 2.0
7
+ - jruby-19mode
8
+ - rbx-19mode
data/Gemfile ADDED
@@ -0,0 +1,10 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'savon', :git => 'https://github.com/savonrb/savon.git', :ref => '5acd246'
4
+
5
+ group :test do
6
+ gem 'rspec', '2.13.0'
7
+ gem 'rspec-mocks', '2.13.1'
8
+ gem 'webmock', '1.9.0'
9
+ gem 'vcr', '2.4.0'
10
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,56 @@
1
+ GIT
2
+ remote: https://github.com/savonrb/savon.git
3
+ revision: 5acd24612d83cea2a2e06133e1173131d856976c
4
+ ref: 5acd246
5
+ specs:
6
+ savon (2.1.0)
7
+ akami (~> 1.2.0)
8
+ builder (>= 2.1.2)
9
+ gyoku (~> 1.0.0)
10
+ httpi (~> 2.0.2)
11
+ nokogiri (>= 1.4.0)
12
+ nori (~> 2.0.3)
13
+ wasabi (~> 3.0.0)
14
+
15
+ GEM
16
+ remote: https://rubygems.org/
17
+ specs:
18
+ addressable (2.3.4)
19
+ akami (1.2.0)
20
+ gyoku (>= 0.4.0)
21
+ nokogiri (>= 1.4.0)
22
+ builder (3.2.0)
23
+ crack (0.3.2)
24
+ diff-lcs (1.2.4)
25
+ gyoku (1.0.0)
26
+ builder (>= 2.1.2)
27
+ httpi (2.0.2)
28
+ rack
29
+ nokogiri (1.5.9)
30
+ nori (2.0.4)
31
+ rack (1.5.2)
32
+ rspec (2.13.0)
33
+ rspec-core (~> 2.13.0)
34
+ rspec-expectations (~> 2.13.0)
35
+ rspec-mocks (~> 2.13.0)
36
+ rspec-core (2.13.1)
37
+ rspec-expectations (2.13.0)
38
+ diff-lcs (>= 1.1.3, < 2.0)
39
+ rspec-mocks (2.13.1)
40
+ vcr (2.4.0)
41
+ wasabi (3.0.0)
42
+ httpi (~> 2.0)
43
+ nokogiri (>= 1.4.0)
44
+ webmock (1.9.0)
45
+ addressable (>= 2.2.7)
46
+ crack (>= 0.1.7)
47
+
48
+ PLATFORMS
49
+ ruby
50
+
51
+ DEPENDENCIES
52
+ rspec (= 2.13.0)
53
+ rspec-mocks (= 2.13.1)
54
+ savon!
55
+ vcr (= 2.4.0)
56
+ webmock (= 1.9.0)
data/README.md ADDED
@@ -0,0 +1,50 @@
1
+ #campaignmasterb
2
+
3
+ [![Build Status](https://travis-ci.org/madebymade/campaignmasterrb.png?branch=master)](https://travis-ci.org/madebymade/campaignmasterrb)
4
+ [![Gem Version](https://badge.fury.io/rb/campaign_master.png)](http://badge.fury.io/rb/campaign_master)
5
+
6
+ Ruby interface that allows you to send subscribers to a [Campaign Master](http://www.campaignmaster.co.uk/) list.
7
+
8
+ Currently no other Campaign Master API functions are supported, though it should be trivial to add these.
9
+
10
+
11
+ ##Installation
12
+
13
+ Campaignmasterrb is available via Rubygems:
14
+
15
+ ```
16
+ gem install campaign_master
17
+ ```
18
+
19
+ or add it to your Gemfile:
20
+
21
+ ```
22
+ gem 'campaign_master'
23
+ ```
24
+
25
+ You'll also currently need to add the GitHub build of the [Savon client](http://savonrb.com/). When the version of Savon on RubyGems has been updated we'll add this as a proper dependency.
26
+
27
+ ```ruby
28
+ gem 'savon', :git => 'https://github.com/savonrb/savon.git', :ref => '5acd246'
29
+ ```
30
+
31
+
32
+ ##Basic usage
33
+
34
+ ```ruby
35
+ require 'campaign_master'
36
+
37
+ format = "EmailAddress,First_Name,IsActive\r\n"
38
+ subscribers = "test@example.org,Derek,1\r\ntest2@example.org,Doreen,1"
39
+ delimiter = ","
40
+
41
+ client = CampaignMaster.client(username, password, client_id)
42
+ client.call(:Subscriber).import(format, delimiter, suscribers)
43
+ ```
44
+
45
+ The format string can contain any fields supported by Campaign Master.
46
+
47
+
48
+ ##License
49
+
50
+ Licensed under [New BSD License](http://opensource.org/licenses/BSD-3-Clause)
@@ -0,0 +1,26 @@
1
+ Gem::Specification.new do |s|
2
+ s.name = 'campaign_master'
3
+ s.version = '1.0.1'
4
+ s.date = '2012-04-23'
5
+ s.summary = "Interface to interact with the Campaign Master API"
6
+ s.description = "Provides the ability to send subscribers to a Campaign Master email list"
7
+ s.authors = ["Chris Blackburn"]
8
+ s.email = 'chris@madebymade.co.uk'
9
+ s.files = ["lib/campaign_master.rb"]
10
+ s.homepage = 'https://github.com/madebymade/campaignmasterrb'
11
+
12
+ s.add_development_dependency 'rspec', '2.13.0'
13
+ s.add_development_dependency 'rspec-mocks', '2.13.1'
14
+ s.add_development_dependency 'webmock', '2.9.0'
15
+ s.add_development_dependency 'vcr', '2.4.0'
16
+
17
+ ignores = File.readlines(".gitignore").grep(/\S+/).map(&:chomp)
18
+ dotfiles = %w[.gitignore .travis.yml]
19
+
20
+ all_files_without_ignores = Dir["**/*"].reject { |f|
21
+ File.directory?(f) || ignores.any? { |i| File.fnmatch(i, f) }
22
+ }
23
+
24
+ s.files = (all_files_without_ignores + dotfiles).sort
25
+ s.require_path = "lib"
26
+ end
@@ -0,0 +1,50 @@
1
+ module CampaignMaster
2
+ class Client
3
+ AuthenticationError = Class.new(RuntimeError)
4
+
5
+ attr_accessor :username, :password, :id
6
+
7
+ def initialize(username, password, id)
8
+ @login_expiration_seconds = -1
9
+ @security_token = false
10
+
11
+ self.username = username
12
+ self.password = password
13
+ self.id = id
14
+ end
15
+
16
+ def get_security_token
17
+ if self.token_expired
18
+ soap_client = CampaignMaster::SoapClient.get_client()
19
+ response = soap_client.call(:login,
20
+ message: { clientID: self.id, userName: self.username, password: self.password },
21
+ :attributes => CampaignMaster::SoapClient.attributes
22
+ )
23
+
24
+ raise AuthenticationError if !self.valid_response?(response)
25
+
26
+ @login_expiration_seconds = Time.now.to_i + response.body[:login_response][:login_result][:minutes_till_token_expires].to_i * 60
27
+ @security_token = response.body[:login_response][:login_result][:token_string]
28
+ end
29
+
30
+ @security_token
31
+ end
32
+
33
+ def token_expired
34
+ @login_expiration_seconds < Time.now.to_i
35
+ end
36
+
37
+ def call(class_name)
38
+ CampaignMaster.const_get(class_name).new(self)
39
+ end
40
+
41
+ protected
42
+ def valid_response?(response)
43
+ (response.body.has_key?(:login_response) and
44
+ response.body[:login_response].has_key?(:login_result) and
45
+ response.body[:login_response][:login_result].has_key?(:minutes_till_token_expires) and
46
+ response.body[:login_response][:login_result].has_key?(:token_string) and
47
+ response.body[:login_response][:login_result][:minutes_till_token_expires].to_i > 0)
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,20 @@
1
+ module Savon
2
+ def self.extract_envelope_from_response_body(response_body)
3
+ envelope_start = response_body.index("<s:Envelope")
4
+ envelope_end = response_body.index("</s:Envelope>") + 12
5
+
6
+ response_body[envelope_start..envelope_end]
7
+ end
8
+
9
+ class Response
10
+ def to_xml
11
+ Savon::extract_envelope_from_response_body(@http.body)
12
+ end
13
+ end
14
+
15
+ class SOAPFault
16
+ def to_hash
17
+ nori.parse(Savon::extract_envelope_from_response_body(@http.body))[:envelope][:body]
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,35 @@
1
+ module CampaignMaster
2
+ class SoapClient
3
+ def self.get_client(soap_header = nil)
4
+ options = {
5
+ wsdl: CampaignMaster.wsdl,
6
+ ssl_verify_mode: :none,
7
+ convert_request_keys_to: :none,
8
+ env_namespace: :S,
9
+ namespace_identifier: nil,
10
+ namespaces: self::namespaces,
11
+ log_level: :warn
12
+ }
13
+
14
+ options = options.merge({soap_header: soap_header}) if !soap_header.nil?
15
+
16
+ Savon.client(options)
17
+ end
18
+
19
+ def self.namespaces
20
+ {
21
+ "xmlns:ns2" => "http://campaignmaster.com.au",
22
+ "xmlns:ns3" => "http://schemas.datacontract.org/2004/07/ECM.BLL.WebServices.Client.API.DataContracts",
23
+ "xmlns:ns4" => "http://schemas.microsoft.com/2003/10/Serialization/",
24
+ "xmlns:ns5" => "http://schemas.datacontract.org/2004/07/ECM.Model",
25
+ "xmlns:ns1381" => "http://campaignmaster.com.au"
26
+ }
27
+ end
28
+
29
+ def self.attributes
30
+ {
31
+ "xmlns" => "http://campaignmaster.com.au"
32
+ }
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,56 @@
1
+ require 'base64'
2
+
3
+ module CampaignMaster
4
+ class Subscriber
5
+ ImportError = Class.new(RuntimeError)
6
+
7
+ attr_accessor :client
8
+
9
+ def initialize(client)
10
+ self.client = client
11
+ end
12
+
13
+ def import(format, delimeter, subscribers)
14
+ soap_client = CampaignMaster::SoapClient.get_client(self.get_import_headers(delimeter))
15
+
16
+ response = soap_client.call(:submit_import_job,
17
+ message_tag: "SubmitJobRequest",
18
+ message: { FileToImport: Base64.encode64("#{format}\r\n#{subscribers}") },
19
+ :attributes => CampaignMaster::SoapClient.attributes
20
+ )
21
+
22
+ raise ImportError if !self.valid_response?(response)
23
+
24
+ response.body[:job_submission_result_message][:job_id].to_i
25
+ end
26
+
27
+ protected
28
+ def get_import_headers(delimeter)
29
+ {
30
+ "ns2:SecurityToken" => { "ns3:Value" => self.client.get_security_token() },
31
+ "ns2:JobDefinition" => {
32
+ "ns3:Delimiter" => delimeter,
33
+ "ns3:Filename" => "import.txt",
34
+ "ns3:InsertSettings" => {
35
+ "ns5:AllowImport" => true,
36
+ "ns5:MakeActive" => true,
37
+ "ns5:MakeVerified" => true
38
+ },
39
+ "ns3:PrimaryKey" => "EmailAddress",
40
+ "ns3:UpdateSettings" => {
41
+ "ns5:AllowImport" => true,
42
+ "ns5:MakeActive" => true,
43
+ "ns5:MakeVerified" => true
44
+ },
45
+ "ns3:UseFirstDuplicate" => 1
46
+ }
47
+ }
48
+ end
49
+
50
+ def valid_response?(response)
51
+ (response.body.has_key?(:job_submission_result_message) and
52
+ response.body[:job_submission_result_message].has_key?(:job_id) and
53
+ response.body[:job_submission_result_message][:job_id].to_i > 0)
54
+ end
55
+ end
56
+ end
@@ -0,0 +1,47 @@
1
+ require 'spec_helper'
2
+
3
+ describe CampaignMaster::Client do
4
+ describe ".new" do
5
+ it "accepts a username, password and client ID as constructor arguments" do
6
+ client = ClientSupport.get_good_client
7
+
8
+ expect(client.username).to eq 'derek'
9
+ expect(client.password).to eq 'password'
10
+ expect(client.id).to eq 123
11
+ end
12
+ end
13
+
14
+ describe ".get_security_token" do
15
+ it "will return the cached security token if it has not expired" do
16
+ client = ClientSupport.get_good_client
17
+
18
+ VCR.use_cassette('login_successful') do
19
+ client.get_security_token()
20
+ end
21
+
22
+ expect(client.get_security_token()).to eq "secrettoken"
23
+ end
24
+
25
+ it "will fetch a new security token if it has expired" do
26
+ client = ClientSupport.get_good_client
27
+
28
+ VCR.use_cassette('login_successful') do
29
+ expect(client.get_security_token()).to eq "secrettoken"
30
+ end
31
+
32
+ client.stub(:token_expired).and_return(true)
33
+
34
+ VCR.use_cassette('login_successful_new_token') do
35
+ expect(client.get_security_token()).to eq "newsecrettoken"
36
+ end
37
+ end
38
+
39
+ it "will raise an exception if bad credentials are passed" do
40
+ client = ClientSupport.get_bad_client
41
+
42
+ VCR.use_cassette('login_unsuccessful') do
43
+ expect { client.get_security_token() }.to raise_error
44
+ end
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,12 @@
1
+ require 'spec_helper'
2
+
3
+ describe Savon do
4
+ describe ".extract_envelope_from_response_body" do
5
+ it "extracts all the envelope from a crufty response body" do
6
+ useful_response = "<s:Envelope><payload>value</payload></s:Envelope>"
7
+ crufty_response = "some-cruft---#{useful_response}---more-cruft"
8
+
9
+ expect(Savon.extract_envelope_from_response_body(crufty_response)).to eq useful_response
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,37 @@
1
+ require 'spec_helper'
2
+
3
+ describe CampaignMaster::SoapClient do
4
+ describe ".get_client" do
5
+ it "returns an instance of Savon::Client" do
6
+ CampaignMaster::SoapClient.get_client.should be_a(Savon::Client)
7
+ end
8
+
9
+ it "includes the soap_header in the headers if the argument is passed" do
10
+ soap_header = {"test" => "example"}
11
+
12
+ soap_client = CampaignMaster::SoapClient.get_client(soap_header)
13
+ expect(soap_client.globals[:soap_header]).to be soap_header
14
+ end
15
+
16
+ it "omits the soap_header from the headers if no argument is passed" do
17
+ soap_client = CampaignMaster::SoapClient.get_client()
18
+ expect(soap_client.globals[:soap_header]).to be_nil
19
+ end
20
+ end
21
+
22
+ describe ".namespaces" do
23
+ it "returns a hash containing the necessary namespaces for a SOAP request" do
24
+ expect(CampaignMaster::SoapClient.namespaces["xmlns:ns2"]).to eq "http://campaignmaster.com.au"
25
+ expect(CampaignMaster::SoapClient.namespaces["xmlns:ns3"]).to eq "http://schemas.datacontract.org/2004/07/ECM.BLL.WebServices.Client.API.DataContracts"
26
+ expect(CampaignMaster::SoapClient.namespaces["xmlns:ns4"]).to eq "http://schemas.microsoft.com/2003/10/Serialization/"
27
+ expect(CampaignMaster::SoapClient.namespaces["xmlns:ns5"]).to eq "http://schemas.datacontract.org/2004/07/ECM.Model"
28
+ expect(CampaignMaster::SoapClient.namespaces["xmlns:ns1381"]).to eq "http://campaignmaster.com.au"
29
+ end
30
+ end
31
+
32
+ describe ".attributes" do
33
+ it "returns the attributes necessary to make a SOAP request" do
34
+ expect(CampaignMaster::SoapClient.attributes["xmlns"]).to eq "http://campaignmaster.com.au"
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,64 @@
1
+ require 'spec_helper'
2
+
3
+ describe CampaignMaster::Subscriber do
4
+ describe ".new" do
5
+ it "sets the value of the client property to the passed argument" do
6
+ arg = "client_dummy"
7
+ subscriber = CampaignMaster::Subscriber.new(arg)
8
+ expect(subscriber.client).to eq arg
9
+ end
10
+ end
11
+
12
+ describe ".import" do
13
+ it "returns the Job ID if it's successfully called" do
14
+ import_data = SubscriberSupport.get_import_data
15
+ client = ClientSupport.get_good_client
16
+
17
+ VCR.use_cassette('login_import_successful') do
18
+ response = client.call(:Subscriber).import(import_data[:format], import_data[:subscribers], import_data[:delimiter])
19
+ expect(response).to eq 123456
20
+ end
21
+ end
22
+
23
+ it "raises an exception if an invalid response is received" do
24
+ import_data = SubscriberSupport.get_import_data
25
+ client = ClientSupport.get_good_client
26
+ subscriber = client.call(:Subscriber)
27
+
28
+ subscriber.stub("valid_response?").and_return(false)
29
+
30
+ VCR.use_cassette('login_import_successful') do
31
+ expect { subscriber.import(import_data[:format], import_data[:subscribers], import_data[:delimiter]) }.to raise_error
32
+ end
33
+ end
34
+ end
35
+
36
+ describe ".get_import_headers" do
37
+ it "returns a hash containing the SOAP headers for the request" do
38
+ client = ClientSupport.get_good_client
39
+ subscriber = client.call(:Subscriber)
40
+
41
+ VCR.use_cassette('login_successful') do
42
+ expect(subscriber.send(:get_import_headers, ",")["ns2:JobDefinition"]["ns3:Filename"]).to eq "import.txt"
43
+ end
44
+ end
45
+
46
+ it "take a delimeter parameter and includes this in the headers" do
47
+ client = ClientSupport.get_good_client
48
+ subscriber = client.call(:Subscriber)
49
+
50
+ VCR.use_cassette('login_successful') do
51
+ expect(subscriber.send(:get_import_headers, "^^")["ns2:JobDefinition"]["ns3:Delimiter"]).to eq "^^"
52
+ end
53
+ end
54
+
55
+ it "returns the authentication information in the headers" do
56
+ client = ClientSupport.get_good_client
57
+ subscriber = client.call(:Subscriber)
58
+
59
+ VCR.use_cassette('login_successful') do
60
+ expect(subscriber.send(:get_import_headers, ",")["ns2:SecurityToken"]["ns3:Value"]).to eq "secrettoken"
61
+ end
62
+ end
63
+ end
64
+ end
@@ -0,0 +1,240 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://api.campaignmaster.co.uk/v1.1/CampaignMasterJobService.svc?wsdl
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - ! '*/*'
12
+ User-Agent:
13
+ - Ruby
14
+ response:
15
+ status:
16
+ code: 200
17
+ message: OK
18
+ headers:
19
+ Date:
20
+ - Mon, 22 Apr 2013 17:36:58 GMT
21
+ Server:
22
+ - Microsoft-IIS/6.0
23
+ X-Powered-By:
24
+ - ASP.NET
25
+ X-Aspnet-Version:
26
+ - 4.0.30319
27
+ Content-Length:
28
+ - '3663'
29
+ Cache-Control:
30
+ - private
31
+ Content-Type:
32
+ - text/xml; charset=UTF-8
33
+ body:
34
+ encoding: US-ASCII
35
+ string: <?xml version="1.0" encoding="utf-8"?><wsdl:definitions name="CampaignMasterJobService"
36
+ targetNamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
37
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
38
+ xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
39
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
40
+ xmlns:tns="http://tempuri.org/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
41
+ xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:i0="http://campaignmaster.com.au"
42
+ xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
43
+ xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsa10="http://www.w3.org/2005/08/addressing"
44
+ xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata"><wsp:Policy
45
+ wsu:Id="BasicHttpBinding_ICampaignMasterJobService_policy"><wsp:ExactlyOne><wsp:All><wsoma:OptimizedMimeSerialization
46
+ xmlns:wsoma="http://schemas.xmlsoap.org/ws/2004/09/policy/optimizedmimeserialization"/><sp:TransportBinding
47
+ xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy"><wsp:Policy><sp:TransportToken><wsp:Policy><sp:HttpsToken
48
+ RequireClientCertificate="false"/></wsp:Policy></sp:TransportToken><sp:AlgorithmSuite><wsp:Policy><sp:Basic256/></wsp:Policy></sp:AlgorithmSuite><sp:Layout><wsp:Policy><sp:Strict/></wsp:Policy></sp:Layout></wsp:Policy></sp:TransportBinding></wsp:All></wsp:ExactlyOne></wsp:Policy><wsdl:import
49
+ namespace="http://campaignmaster.com.au" location="http://api.campaignmaster.co.uk/v1.1/CampaignMasterJobService.svc?wsdl=wsdl0"/><wsdl:types/><wsdl:binding
50
+ name="BasicHttpBinding_ICampaignMasterJobService" type="i0:ICampaignMasterJobService"><wsp:PolicyReference
51
+ URI="#BasicHttpBinding_ICampaignMasterJobService_policy"/><soap:binding transport="http://schemas.xmlsoap.org/soap/http"/><wsdl:operation
52
+ name="Login"><soap:operation soapAction="http://campaignmaster.com.au/IAPIService/Login"
53
+ style="document"/><wsdl:input><soap:body use="literal"/></wsdl:input><wsdl:output><soap:body
54
+ use="literal"/></wsdl:output></wsdl:operation><wsdl:operation name="GetServerTime"><soap:operation
55
+ soapAction="http://campaignmaster.com.au/IAPIService/GetServerTime" style="document"/><wsdl:input><soap:body
56
+ use="literal"/></wsdl:input><wsdl:output><soap:body use="literal"/></wsdl:output></wsdl:operation><wsdl:operation
57
+ name="SubmitImportJob"><soap:operation soapAction="http://campaignmaster.com.au/ICampaignMasterJobService/SubmitImportJob"
58
+ style="document"/><wsdl:input name="SubmitJobRequest"><soap:header message="i0:SubmitJobRequest_Headers"
59
+ part="JobDefinition" use="literal"/><soap:header message="i0:SubmitJobRequest_Headers"
60
+ part="SecurityToken" use="literal"/><soap:body use="literal"/></wsdl:input><wsdl:output
61
+ name="JobSubmissionResultMessage"><soap:body use="literal"/></wsdl:output></wsdl:operation><wsdl:operation
62
+ name="GetJobResult"><soap:operation soapAction="http://campaignmaster.com.au/ICampaignMasterJobService/GetJobResult"
63
+ style="document"/><wsdl:input><soap:body use="literal"/></wsdl:input><wsdl:output><soap:body
64
+ use="literal"/></wsdl:output></wsdl:operation></wsdl:binding><wsdl:service
65
+ name="CampaignMasterJobService"><wsdl:port name="BasicHttpBinding_ICampaignMasterJobService"
66
+ binding="tns:BasicHttpBinding_ICampaignMasterJobService"><soap:address location="https://api.campaignmaster.co.uk/v1.1/CampaignMasterJobService.svc"/></wsdl:port></wsdl:service></wsdl:definitions>
67
+ http_version:
68
+ recorded_at: Mon, 22 Apr 2013 17:36:58 GMT
69
+ - request:
70
+ method: post
71
+ uri: https://api.campaignmaster.co.uk/v1.1/CampaignMasterJobService.svc
72
+ body:
73
+ encoding: US-ASCII
74
+ string: <?xml version="1.0" encoding="UTF-8"?><S:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
75
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://tempuri.org/"
76
+ xmlns:S="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns2="http://campaignmaster.com.au"
77
+ xmlns:ns3="http://schemas.datacontract.org/2004/07/ECM.BLL.WebServices.Client.API.DataContracts"
78
+ xmlns:ns4="http://schemas.microsoft.com/2003/10/Serialization/" xmlns:ns5="http://schemas.datacontract.org/2004/07/ECM.Model"
79
+ xmlns:ns1381="http://campaignmaster.com.au"><S:Body><Login xmlns="http://campaignmaster.com.au"><clientID>123</clientID><userName>test</userName><password>secret</password></Login></S:Body></S:Envelope>
80
+ headers:
81
+ Soapaction:
82
+ - ! '"http://campaignmaster.com.au/IAPIService/Login"'
83
+ Content-Type:
84
+ - text/xml;charset=UTF-8
85
+ Content-Length:
86
+ - '703'
87
+ Accept:
88
+ - ! '*/*'
89
+ User-Agent:
90
+ - Ruby
91
+ response:
92
+ status:
93
+ code: 200
94
+ message: OK
95
+ headers:
96
+ Date:
97
+ - Mon, 22 Apr 2013 17:36:58 GMT
98
+ Server:
99
+ - Microsoft-IIS/6.0
100
+ X-Powered-By:
101
+ - ASP.NET
102
+ X-Aspnet-Version:
103
+ - 4.0.30319
104
+ Mime-Version:
105
+ - '1.0'
106
+ Transfer-Encoding:
107
+ - chunked
108
+ Cache-Control:
109
+ - private
110
+ Content-Type:
111
+ - multipart/related; type="application/xop+xml";start="<http://tempuri.org/0>";boundary="uuid:fce5172b-0f2c-439c-8ab8-89822c5a80f8+id=1";start-info="text/xml"
112
+ body:
113
+ encoding: US-ASCII
114
+ string: ! "\r\n--uuid:fce5172b-0f2c-439c-8ab8-89822c5a80f8+id=1\r\nContent-ID:
115
+ <http://tempuri.org/0>\r\nContent-Transfer-Encoding: 8bit\r\nContent-Type:
116
+ application/xop+xml;charset=utf-8;type=\"text/xml\"\r\n\r\n<s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\"><s:Body
117
+ xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"><LoginResponse
118
+ xmlns=\"http://campaignmaster.com.au\"><LoginResult><TokenString>testtoken</TokenString><MinutesTillTokenExpires>480</MinutesTillTokenExpires></LoginResult></LoginResponse></s:Body></s:Envelope>\r\n--uuid:fce5172b-0f2c-439c-8ab8-89822c5a80f8+id=1--\r\n"
119
+ http_version:
120
+ recorded_at: Mon, 22 Apr 2013 17:36:58 GMT
121
+ - request:
122
+ method: get
123
+ uri: http://api.campaignmaster.co.uk/v1.1/CampaignMasterJobService.svc?wsdl
124
+ body:
125
+ encoding: US-ASCII
126
+ string: ''
127
+ headers:
128
+ Accept:
129
+ - ! '*/*'
130
+ User-Agent:
131
+ - Ruby
132
+ response:
133
+ status:
134
+ code: 200
135
+ message: OK
136
+ headers:
137
+ Date:
138
+ - Mon, 22 Apr 2013 17:36:58 GMT
139
+ Server:
140
+ - Microsoft-IIS/6.0
141
+ X-Powered-By:
142
+ - ASP.NET
143
+ X-Aspnet-Version:
144
+ - 4.0.30319
145
+ Content-Length:
146
+ - '3663'
147
+ Cache-Control:
148
+ - private
149
+ Content-Type:
150
+ - text/xml; charset=UTF-8
151
+ body:
152
+ encoding: US-ASCII
153
+ string: <?xml version="1.0" encoding="utf-8"?><wsdl:definitions name="CampaignMasterJobService"
154
+ targetNamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
155
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
156
+ xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
157
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
158
+ xmlns:tns="http://tempuri.org/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
159
+ xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:i0="http://campaignmaster.com.au"
160
+ xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
161
+ xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsa10="http://www.w3.org/2005/08/addressing"
162
+ xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata"><wsp:Policy
163
+ wsu:Id="BasicHttpBinding_ICampaignMasterJobService_policy"><wsp:ExactlyOne><wsp:All><wsoma:OptimizedMimeSerialization
164
+ xmlns:wsoma="http://schemas.xmlsoap.org/ws/2004/09/policy/optimizedmimeserialization"/><sp:TransportBinding
165
+ xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy"><wsp:Policy><sp:TransportToken><wsp:Policy><sp:HttpsToken
166
+ RequireClientCertificate="false"/></wsp:Policy></sp:TransportToken><sp:AlgorithmSuite><wsp:Policy><sp:Basic256/></wsp:Policy></sp:AlgorithmSuite><sp:Layout><wsp:Policy><sp:Strict/></wsp:Policy></sp:Layout></wsp:Policy></sp:TransportBinding></wsp:All></wsp:ExactlyOne></wsp:Policy><wsdl:import
167
+ namespace="http://campaignmaster.com.au" location="http://api.campaignmaster.co.uk/v1.1/CampaignMasterJobService.svc?wsdl=wsdl0"/><wsdl:types/><wsdl:binding
168
+ name="BasicHttpBinding_ICampaignMasterJobService" type="i0:ICampaignMasterJobService"><wsp:PolicyReference
169
+ URI="#BasicHttpBinding_ICampaignMasterJobService_policy"/><soap:binding transport="http://schemas.xmlsoap.org/soap/http"/><wsdl:operation
170
+ name="Login"><soap:operation soapAction="http://campaignmaster.com.au/IAPIService/Login"
171
+ style="document"/><wsdl:input><soap:body use="literal"/></wsdl:input><wsdl:output><soap:body
172
+ use="literal"/></wsdl:output></wsdl:operation><wsdl:operation name="GetServerTime"><soap:operation
173
+ soapAction="http://campaignmaster.com.au/IAPIService/GetServerTime" style="document"/><wsdl:input><soap:body
174
+ use="literal"/></wsdl:input><wsdl:output><soap:body use="literal"/></wsdl:output></wsdl:operation><wsdl:operation
175
+ name="SubmitImportJob"><soap:operation soapAction="http://campaignmaster.com.au/ICampaignMasterJobService/SubmitImportJob"
176
+ style="document"/><wsdl:input name="SubmitJobRequest"><soap:header message="i0:SubmitJobRequest_Headers"
177
+ part="JobDefinition" use="literal"/><soap:header message="i0:SubmitJobRequest_Headers"
178
+ part="SecurityToken" use="literal"/><soap:body use="literal"/></wsdl:input><wsdl:output
179
+ name="JobSubmissionResultMessage"><soap:body use="literal"/></wsdl:output></wsdl:operation><wsdl:operation
180
+ name="GetJobResult"><soap:operation soapAction="http://campaignmaster.com.au/ICampaignMasterJobService/GetJobResult"
181
+ style="document"/><wsdl:input><soap:body use="literal"/></wsdl:input><wsdl:output><soap:body
182
+ use="literal"/></wsdl:output></wsdl:operation></wsdl:binding><wsdl:service
183
+ name="CampaignMasterJobService"><wsdl:port name="BasicHttpBinding_ICampaignMasterJobService"
184
+ binding="tns:BasicHttpBinding_ICampaignMasterJobService"><soap:address location="https://api.campaignmaster.co.uk/v1.1/CampaignMasterJobService.svc"/></wsdl:port></wsdl:service></wsdl:definitions>
185
+ http_version:
186
+ recorded_at: Mon, 22 Apr 2013 17:36:58 GMT
187
+ - request:
188
+ method: post
189
+ uri: https://api.campaignmaster.co.uk/v1.1/CampaignMasterJobService.svc
190
+ body:
191
+ encoding: US-ASCII
192
+ string: ! "<?xml version=\"1.0\" encoding=\"UTF-8\"?><S:Envelope xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"
193
+ xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns=\"http://tempuri.org/\"
194
+ xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:ns2=\"http://campaignmaster.com.au\"
195
+ xmlns:ns3=\"http://schemas.datacontract.org/2004/07/ECM.BLL.WebServices.Client.API.DataContracts\"
196
+ xmlns:ns4=\"http://schemas.microsoft.com/2003/10/Serialization/\" xmlns:ns5=\"http://schemas.datacontract.org/2004/07/ECM.Model\"
197
+ xmlns:ns1381=\"http://campaignmaster.com.au\"><S:Header><ns2:SecurityToken><ns3:Value>testtoken</ns3:Value></ns2:SecurityToken><ns2:JobDefinition><ns3:Delimiter>test@example.org,Test
198
+ Subscriber,1\r\ntest2@example.org,Test Subscriber 2</ns3:Delimiter><ns3:Filename>import.txt</ns3:Filename><ns3:InsertSettings><ns5:AllowImport>true</ns5:AllowImport><ns5:MakeActive>true</ns5:MakeActive><ns5:MakeVerified>true</ns5:MakeVerified></ns3:InsertSettings><ns3:PrimaryKey>EmailAddress</ns3:PrimaryKey><ns3:UpdateSettings><ns5:AllowImport>true</ns5:AllowImport><ns5:MakeActive>true</ns5:MakeActive><ns5:MakeVerified>true</ns5:MakeVerified></ns3:UpdateSettings><ns3:UseFirstDuplicate>1</ns3:UseFirstDuplicate></ns2:JobDefinition></S:Header><S:Body><SubmitJobRequest
199
+ xmlns=\"http://campaignmaster.com.au\"><FileToImport>RW1haWxBZGRyZXNzLEZpcnN0X05hbWUsSXNBY3RpdmUNCg0KLA==\n</FileToImport></SubmitJobRequest></S:Body></S:Envelope>"
200
+ headers:
201
+ Soapaction:
202
+ - ! '"http://campaignmaster.com.au/ICampaignMasterJobService/SubmitImportJob"'
203
+ Content-Type:
204
+ - text/xml;charset=UTF-8
205
+ Content-Length:
206
+ - '1503'
207
+ Accept:
208
+ - ! '*/*'
209
+ User-Agent:
210
+ - Ruby
211
+ response:
212
+ status:
213
+ code: 200
214
+ message: OK
215
+ headers:
216
+ Date:
217
+ - Mon, 22 Apr 2013 17:36:58 GMT
218
+ Server:
219
+ - Microsoft-IIS/6.0
220
+ X-Powered-By:
221
+ - ASP.NET
222
+ X-Aspnet-Version:
223
+ - 4.0.30319
224
+ Mime-Version:
225
+ - '1.0'
226
+ Transfer-Encoding:
227
+ - chunked
228
+ Cache-Control:
229
+ - private
230
+ Content-Type:
231
+ - multipart/related; type="application/xop+xml";start="<http://tempuri.org/0>";boundary="uuid:fce5172b-0f2c-439c-8ab8-89822c5a80f8+id=2";start-info="text/xml"
232
+ body:
233
+ encoding: US-ASCII
234
+ string: ! "\r\n--uuid:fce5172b-0f2c-439c-8ab8-89822c5a80f8+id=2\r\nContent-ID:
235
+ <http://tempuri.org/0>\r\nContent-Transfer-Encoding: 8bit\r\nContent-Type:
236
+ application/xop+xml;charset=utf-8;type=\"text/xml\"\r\n\r\n<s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\"><s:Body><JobSubmissionResultMessage
237
+ xmlns=\"http://campaignmaster.com.au\"><JobId>123456</JobId></JobSubmissionResultMessage></s:Body></s:Envelope>\r\n--uuid:fce5172b-0f2c-439c-8ab8-89822c5a80f8+id=2--\r\n"
238
+ http_version:
239
+ recorded_at: Mon, 22 Apr 2013 17:36:58 GMT
240
+ recorded_with: VCR 2.4.0
@@ -0,0 +1,121 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://api.campaignmaster.co.uk/v1.1/CampaignMasterJobService.svc?wsdl
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - ! '*/*'
12
+ User-Agent:
13
+ - Ruby
14
+ response:
15
+ status:
16
+ code: 200
17
+ message: OK
18
+ headers:
19
+ Date:
20
+ - Mon, 22 Apr 2013 16:35:11 GMT
21
+ Server:
22
+ - Microsoft-IIS/6.0
23
+ X-Powered-By:
24
+ - ASP.NET
25
+ X-Aspnet-Version:
26
+ - 4.0.30319
27
+ Content-Length:
28
+ - '3663'
29
+ Cache-Control:
30
+ - private
31
+ Content-Type:
32
+ - text/xml; charset=UTF-8
33
+ body:
34
+ encoding: US-ASCII
35
+ string: <?xml version="1.0" encoding="utf-8"?><wsdl:definitions name="CampaignMasterJobService"
36
+ targetNamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
37
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
38
+ xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
39
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
40
+ xmlns:tns="http://tempuri.org/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
41
+ xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:i0="http://campaignmaster.com.au"
42
+ xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
43
+ xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsa10="http://www.w3.org/2005/08/addressing"
44
+ xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata"><wsp:Policy
45
+ wsu:Id="BasicHttpBinding_ICampaignMasterJobService_policy"><wsp:ExactlyOne><wsp:All><wsoma:OptimizedMimeSerialization
46
+ xmlns:wsoma="http://schemas.xmlsoap.org/ws/2004/09/policy/optimizedmimeserialization"/><sp:TransportBinding
47
+ xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy"><wsp:Policy><sp:TransportToken><wsp:Policy><sp:HttpsToken
48
+ RequireClientCertificate="false"/></wsp:Policy></sp:TransportToken><sp:AlgorithmSuite><wsp:Policy><sp:Basic256/></wsp:Policy></sp:AlgorithmSuite><sp:Layout><wsp:Policy><sp:Strict/></wsp:Policy></sp:Layout></wsp:Policy></sp:TransportBinding></wsp:All></wsp:ExactlyOne></wsp:Policy><wsdl:import
49
+ namespace="http://campaignmaster.com.au" location="http://api.campaignmaster.co.uk/v1.1/CampaignMasterJobService.svc?wsdl=wsdl0"/><wsdl:types/><wsdl:binding
50
+ name="BasicHttpBinding_ICampaignMasterJobService" type="i0:ICampaignMasterJobService"><wsp:PolicyReference
51
+ URI="#BasicHttpBinding_ICampaignMasterJobService_policy"/><soap:binding transport="http://schemas.xmlsoap.org/soap/http"/><wsdl:operation
52
+ name="Login"><soap:operation soapAction="http://campaignmaster.com.au/IAPIService/Login"
53
+ style="document"/><wsdl:input><soap:body use="literal"/></wsdl:input><wsdl:output><soap:body
54
+ use="literal"/></wsdl:output></wsdl:operation><wsdl:operation name="GetServerTime"><soap:operation
55
+ soapAction="http://campaignmaster.com.au/IAPIService/GetServerTime" style="document"/><wsdl:input><soap:body
56
+ use="literal"/></wsdl:input><wsdl:output><soap:body use="literal"/></wsdl:output></wsdl:operation><wsdl:operation
57
+ name="SubmitImportJob"><soap:operation soapAction="http://campaignmaster.com.au/ICampaignMasterJobService/SubmitImportJob"
58
+ style="document"/><wsdl:input name="SubmitJobRequest"><soap:header message="i0:SubmitJobRequest_Headers"
59
+ part="JobDefinition" use="literal"/><soap:header message="i0:SubmitJobRequest_Headers"
60
+ part="SecurityToken" use="literal"/><soap:body use="literal"/></wsdl:input><wsdl:output
61
+ name="JobSubmissionResultMessage"><soap:body use="literal"/></wsdl:output></wsdl:operation><wsdl:operation
62
+ name="GetJobResult"><soap:operation soapAction="http://campaignmaster.com.au/ICampaignMasterJobService/GetJobResult"
63
+ style="document"/><wsdl:input><soap:body use="literal"/></wsdl:input><wsdl:output><soap:body
64
+ use="literal"/></wsdl:output></wsdl:operation></wsdl:binding><wsdl:service
65
+ name="CampaignMasterJobService"><wsdl:port name="BasicHttpBinding_ICampaignMasterJobService"
66
+ binding="tns:BasicHttpBinding_ICampaignMasterJobService"><soap:address location="https://api.campaignmaster.co.uk/v1.1/CampaignMasterJobService.svc"/></wsdl:port></wsdl:service></wsdl:definitions>
67
+ http_version:
68
+ recorded_at: Mon, 22 Apr 2013 16:35:11 GMT
69
+ - request:
70
+ method: post
71
+ uri: https://api.campaignmaster.co.uk/v1.1/CampaignMasterJobService.svc
72
+ body:
73
+ encoding: US-ASCII
74
+ string: <?xml version="1.0" encoding="UTF-8"?><S:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
75
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://tempuri.org/"
76
+ xmlns:S="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns2="http://campaignmaster.com.au"
77
+ xmlns:ns3="http://schemas.datacontract.org/2004/07/ECM.BLL.WebServices.Client.API.DataContracts"
78
+ xmlns:ns4="http://schemas.microsoft.com/2003/10/Serialization/" xmlns:ns5="http://schemas.datacontract.org/2004/07/ECM.Model"
79
+ xmlns:ns1381="http://campaignmaster.com.au"><S:Body><Login xmlns="http://campaignmaster.com.au"><clientID>123</clientID><userName>derek</userName><password>secret</password></Login></S:Body></S:Envelope>
80
+ headers:
81
+ Soapaction:
82
+ - ! '"http://campaignmaster.com.au/IAPIService/Login"'
83
+ Content-Type:
84
+ - text/xml;charset=UTF-8
85
+ Content-Length:
86
+ - '703'
87
+ Accept:
88
+ - ! '*/*'
89
+ User-Agent:
90
+ - Ruby
91
+ response:
92
+ status:
93
+ code: 200
94
+ message: OK
95
+ headers:
96
+ Date:
97
+ - Mon, 22 Apr 2013 16:35:12 GMT
98
+ Server:
99
+ - Microsoft-IIS/6.0
100
+ X-Powered-By:
101
+ - ASP.NET
102
+ X-Aspnet-Version:
103
+ - 4.0.30319
104
+ Mime-Version:
105
+ - '1.0'
106
+ Transfer-Encoding:
107
+ - chunked
108
+ Cache-Control:
109
+ - private
110
+ Content-Type:
111
+ - multipart/related; type="application/xop+xml";start="<http://tempuri.org/0>";boundary="uuid:df9c2c52-6f6a-4559-ac70-9c4116202651+id=5878";start-info="text/xml"
112
+ body:
113
+ encoding: US-ASCII
114
+ string: ! "\r\n--uuid:df9c2c52-6f6a-4559-ac70-9c4116202651+id=5878\r\nContent-ID:
115
+ <http://tempuri.org/0>\r\nContent-Transfer-Encoding: 8bit\r\nContent-Type:
116
+ application/xop+xml;charset=utf-8;type=\"text/xml\"\r\n\r\n<s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\"><s:Body
117
+ xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"><LoginResponse
118
+ xmlns=\"http://campaignmaster.com.au\"><LoginResult><TokenString>secrettoken</TokenString><MinutesTillTokenExpires>480</MinutesTillTokenExpires></LoginResult></LoginResponse></s:Body></s:Envelope>\r\n--uuid:df9c2c52-6f6a-4559-ac70-9c4116202651+id=5878--\r\n"
119
+ http_version:
120
+ recorded_at: Mon, 22 Apr 2013 16:35:12 GMT
121
+ recorded_with: VCR 2.4.0
@@ -0,0 +1,121 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://api.campaignmaster.co.uk/v1.1/CampaignMasterJobService.svc?wsdl
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - ! '*/*'
12
+ User-Agent:
13
+ - Ruby
14
+ response:
15
+ status:
16
+ code: 200
17
+ message: OK
18
+ headers:
19
+ Date:
20
+ - Mon, 22 Apr 2013 16:35:11 GMT
21
+ Server:
22
+ - Microsoft-IIS/6.0
23
+ X-Powered-By:
24
+ - ASP.NET
25
+ X-Aspnet-Version:
26
+ - 4.0.30319
27
+ Content-Length:
28
+ - '3663'
29
+ Cache-Control:
30
+ - private
31
+ Content-Type:
32
+ - text/xml; charset=UTF-8
33
+ body:
34
+ encoding: US-ASCII
35
+ string: <?xml version="1.0" encoding="utf-8"?><wsdl:definitions name="CampaignMasterJobService"
36
+ targetNamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
37
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
38
+ xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
39
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
40
+ xmlns:tns="http://tempuri.org/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
41
+ xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:i0="http://campaignmaster.com.au"
42
+ xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
43
+ xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsa10="http://www.w3.org/2005/08/addressing"
44
+ xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata"><wsp:Policy
45
+ wsu:Id="BasicHttpBinding_ICampaignMasterJobService_policy"><wsp:ExactlyOne><wsp:All><wsoma:OptimizedMimeSerialization
46
+ xmlns:wsoma="http://schemas.xmlsoap.org/ws/2004/09/policy/optimizedmimeserialization"/><sp:TransportBinding
47
+ xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy"><wsp:Policy><sp:TransportToken><wsp:Policy><sp:HttpsToken
48
+ RequireClientCertificate="false"/></wsp:Policy></sp:TransportToken><sp:AlgorithmSuite><wsp:Policy><sp:Basic256/></wsp:Policy></sp:AlgorithmSuite><sp:Layout><wsp:Policy><sp:Strict/></wsp:Policy></sp:Layout></wsp:Policy></sp:TransportBinding></wsp:All></wsp:ExactlyOne></wsp:Policy><wsdl:import
49
+ namespace="http://campaignmaster.com.au" location="http://api.campaignmaster.co.uk/v1.1/CampaignMasterJobService.svc?wsdl=wsdl0"/><wsdl:types/><wsdl:binding
50
+ name="BasicHttpBinding_ICampaignMasterJobService" type="i0:ICampaignMasterJobService"><wsp:PolicyReference
51
+ URI="#BasicHttpBinding_ICampaignMasterJobService_policy"/><soap:binding transport="http://schemas.xmlsoap.org/soap/http"/><wsdl:operation
52
+ name="Login"><soap:operation soapAction="http://campaignmaster.com.au/IAPIService/Login"
53
+ style="document"/><wsdl:input><soap:body use="literal"/></wsdl:input><wsdl:output><soap:body
54
+ use="literal"/></wsdl:output></wsdl:operation><wsdl:operation name="GetServerTime"><soap:operation
55
+ soapAction="http://campaignmaster.com.au/IAPIService/GetServerTime" style="document"/><wsdl:input><soap:body
56
+ use="literal"/></wsdl:input><wsdl:output><soap:body use="literal"/></wsdl:output></wsdl:operation><wsdl:operation
57
+ name="SubmitImportJob"><soap:operation soapAction="http://campaignmaster.com.au/ICampaignMasterJobService/SubmitImportJob"
58
+ style="document"/><wsdl:input name="SubmitJobRequest"><soap:header message="i0:SubmitJobRequest_Headers"
59
+ part="JobDefinition" use="literal"/><soap:header message="i0:SubmitJobRequest_Headers"
60
+ part="SecurityToken" use="literal"/><soap:body use="literal"/></wsdl:input><wsdl:output
61
+ name="JobSubmissionResultMessage"><soap:body use="literal"/></wsdl:output></wsdl:operation><wsdl:operation
62
+ name="GetJobResult"><soap:operation soapAction="http://campaignmaster.com.au/ICampaignMasterJobService/GetJobResult"
63
+ style="document"/><wsdl:input><soap:body use="literal"/></wsdl:input><wsdl:output><soap:body
64
+ use="literal"/></wsdl:output></wsdl:operation></wsdl:binding><wsdl:service
65
+ name="CampaignMasterJobService"><wsdl:port name="BasicHttpBinding_ICampaignMasterJobService"
66
+ binding="tns:BasicHttpBinding_ICampaignMasterJobService"><soap:address location="https://api.campaignmaster.co.uk/v1.1/CampaignMasterJobService.svc"/></wsdl:port></wsdl:service></wsdl:definitions>
67
+ http_version:
68
+ recorded_at: Mon, 22 Apr 2013 16:35:11 GMT
69
+ - request:
70
+ method: post
71
+ uri: https://api.campaignmaster.co.uk/v1.1/CampaignMasterJobService.svc
72
+ body:
73
+ encoding: US-ASCII
74
+ string: <?xml version="1.0" encoding="UTF-8"?><S:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
75
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://tempuri.org/"
76
+ xmlns:S="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns2="http://campaignmaster.com.au"
77
+ xmlns:ns3="http://schemas.datacontract.org/2004/07/ECM.BLL.WebServices.Client.API.DataContracts"
78
+ xmlns:ns4="http://schemas.microsoft.com/2003/10/Serialization/" xmlns:ns5="http://schemas.datacontract.org/2004/07/ECM.Model"
79
+ xmlns:ns1381="http://campaignmaster.com.au"><S:Body><Login xmlns="http://campaignmaster.com.au"><clientID>123</clientID><userName>derek</userName><password>secret</password></Login></S:Body></S:Envelope>
80
+ headers:
81
+ Soapaction:
82
+ - ! '"http://campaignmaster.com.au/IAPIService/Login"'
83
+ Content-Type:
84
+ - text/xml;charset=UTF-8
85
+ Content-Length:
86
+ - '703'
87
+ Accept:
88
+ - ! '*/*'
89
+ User-Agent:
90
+ - Ruby
91
+ response:
92
+ status:
93
+ code: 200
94
+ message: OK
95
+ headers:
96
+ Date:
97
+ - Mon, 22 Apr 2013 16:35:12 GMT
98
+ Server:
99
+ - Microsoft-IIS/6.0
100
+ X-Powered-By:
101
+ - ASP.NET
102
+ X-Aspnet-Version:
103
+ - 4.0.30319
104
+ Mime-Version:
105
+ - '1.0'
106
+ Transfer-Encoding:
107
+ - chunked
108
+ Cache-Control:
109
+ - private
110
+ Content-Type:
111
+ - multipart/related; type="application/xop+xml";start="<http://tempuri.org/0>";boundary="uuid:df9c2c52-6f6a-4559-ac70-9c4116202651+id=5878";start-info="text/xml"
112
+ body:
113
+ encoding: US-ASCII
114
+ string: ! "\r\n--uuid:df9c2c52-6f6a-4559-ac70-9c4116202651+id=5878\r\nContent-ID:
115
+ <http://tempuri.org/0>\r\nContent-Transfer-Encoding: 8bit\r\nContent-Type:
116
+ application/xop+xml;charset=utf-8;type=\"text/xml\"\r\n\r\n<s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\"><s:Body
117
+ xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"><LoginResponse
118
+ xmlns=\"http://campaignmaster.com.au\"><LoginResult><TokenString>newsecrettoken</TokenString><MinutesTillTokenExpires>480</MinutesTillTokenExpires></LoginResult></LoginResponse></s:Body></s:Envelope>\r\n--uuid:df9c2c52-6f6a-4559-ac70-9c4116202651+id=5878--\r\n"
119
+ http_version:
120
+ recorded_at: Mon, 22 Apr 2013 16:35:12 GMT
121
+ recorded_with: VCR 2.4.0
@@ -0,0 +1,120 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://api.campaignmaster.co.uk/v1.1/CampaignMasterJobService.svc?wsdl
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - ! '*/*'
12
+ User-Agent:
13
+ - Ruby
14
+ response:
15
+ status:
16
+ code: 200
17
+ message: OK
18
+ headers:
19
+ Date:
20
+ - Mon, 22 Apr 2013 16:38:43 GMT
21
+ Server:
22
+ - Microsoft-IIS/6.0
23
+ X-Powered-By:
24
+ - ASP.NET
25
+ X-Aspnet-Version:
26
+ - 4.0.30319
27
+ Content-Length:
28
+ - '3663'
29
+ Cache-Control:
30
+ - private
31
+ Content-Type:
32
+ - text/xml; charset=UTF-8
33
+ body:
34
+ encoding: US-ASCII
35
+ string: <?xml version="1.0" encoding="utf-8"?><wsdl:definitions name="CampaignMasterJobService"
36
+ targetNamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
37
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
38
+ xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
39
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
40
+ xmlns:tns="http://tempuri.org/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
41
+ xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:i0="http://campaignmaster.com.au"
42
+ xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
43
+ xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsa10="http://www.w3.org/2005/08/addressing"
44
+ xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata"><wsp:Policy
45
+ wsu:Id="BasicHttpBinding_ICampaignMasterJobService_policy"><wsp:ExactlyOne><wsp:All><wsoma:OptimizedMimeSerialization
46
+ xmlns:wsoma="http://schemas.xmlsoap.org/ws/2004/09/policy/optimizedmimeserialization"/><sp:TransportBinding
47
+ xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy"><wsp:Policy><sp:TransportToken><wsp:Policy><sp:HttpsToken
48
+ RequireClientCertificate="false"/></wsp:Policy></sp:TransportToken><sp:AlgorithmSuite><wsp:Policy><sp:Basic256/></wsp:Policy></sp:AlgorithmSuite><sp:Layout><wsp:Policy><sp:Strict/></wsp:Policy></sp:Layout></wsp:Policy></sp:TransportBinding></wsp:All></wsp:ExactlyOne></wsp:Policy><wsdl:import
49
+ namespace="http://campaignmaster.com.au" location="http://api.campaignmaster.co.uk/v1.1/CampaignMasterJobService.svc?wsdl=wsdl0"/><wsdl:types/><wsdl:binding
50
+ name="BasicHttpBinding_ICampaignMasterJobService" type="i0:ICampaignMasterJobService"><wsp:PolicyReference
51
+ URI="#BasicHttpBinding_ICampaignMasterJobService_policy"/><soap:binding transport="http://schemas.xmlsoap.org/soap/http"/><wsdl:operation
52
+ name="Login"><soap:operation soapAction="http://campaignmaster.com.au/IAPIService/Login"
53
+ style="document"/><wsdl:input><soap:body use="literal"/></wsdl:input><wsdl:output><soap:body
54
+ use="literal"/></wsdl:output></wsdl:operation><wsdl:operation name="GetServerTime"><soap:operation
55
+ soapAction="http://campaignmaster.com.au/IAPIService/GetServerTime" style="document"/><wsdl:input><soap:body
56
+ use="literal"/></wsdl:input><wsdl:output><soap:body use="literal"/></wsdl:output></wsdl:operation><wsdl:operation
57
+ name="SubmitImportJob"><soap:operation soapAction="http://campaignmaster.com.au/ICampaignMasterJobService/SubmitImportJob"
58
+ style="document"/><wsdl:input name="SubmitJobRequest"><soap:header message="i0:SubmitJobRequest_Headers"
59
+ part="JobDefinition" use="literal"/><soap:header message="i0:SubmitJobRequest_Headers"
60
+ part="SecurityToken" use="literal"/><soap:body use="literal"/></wsdl:input><wsdl:output
61
+ name="JobSubmissionResultMessage"><soap:body use="literal"/></wsdl:output></wsdl:operation><wsdl:operation
62
+ name="GetJobResult"><soap:operation soapAction="http://campaignmaster.com.au/ICampaignMasterJobService/GetJobResult"
63
+ style="document"/><wsdl:input><soap:body use="literal"/></wsdl:input><wsdl:output><soap:body
64
+ use="literal"/></wsdl:output></wsdl:operation></wsdl:binding><wsdl:service
65
+ name="CampaignMasterJobService"><wsdl:port name="BasicHttpBinding_ICampaignMasterJobService"
66
+ binding="tns:BasicHttpBinding_ICampaignMasterJobService"><soap:address location="https://api.campaignmaster.co.uk/v1.1/CampaignMasterJobService.svc"/></wsdl:port></wsdl:service></wsdl:definitions>
67
+ http_version:
68
+ recorded_at: Mon, 22 Apr 2013 16:38:43 GMT
69
+ - request:
70
+ method: post
71
+ uri: https://api.campaignmaster.co.uk/v1.1/CampaignMasterJobService.svc
72
+ body:
73
+ encoding: US-ASCII
74
+ string: <?xml version="1.0" encoding="UTF-8"?><S:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
75
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://tempuri.org/"
76
+ xmlns:S="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns2="http://campaignmaster.com.au"
77
+ xmlns:ns3="http://schemas.datacontract.org/2004/07/ECM.BLL.WebServices.Client.API.DataContracts"
78
+ xmlns:ns4="http://schemas.microsoft.com/2003/10/Serialization/" xmlns:ns5="http://schemas.datacontract.org/2004/07/ECM.Model"
79
+ xmlns:ns1381="http://campaignmaster.com.au"><S:Body><Login xmlns="http://campaignmaster.com.au"><clientID>123</clientID><userName>derek</userName><password>badsecret</password></Login></S:Body></S:Envelope>
80
+ headers:
81
+ Soapaction:
82
+ - ! '"http://campaignmaster.com.au/IAPIService/Login"'
83
+ Content-Type:
84
+ - text/xml;charset=UTF-8
85
+ Content-Length:
86
+ - '699'
87
+ Accept:
88
+ - ! '*/*'
89
+ User-Agent:
90
+ - Ruby
91
+ response:
92
+ status:
93
+ code: 500
94
+ message: Internal Server Error
95
+ headers:
96
+ Connection:
97
+ - close
98
+ Date:
99
+ - Mon, 22 Apr 2013 16:38:43 GMT
100
+ Server:
101
+ - Microsoft-IIS/6.0
102
+ X-Powered-By:
103
+ - ASP.NET
104
+ X-Aspnet-Version:
105
+ - 4.0.30319
106
+ Mime-Version:
107
+ - '1.0'
108
+ Cache-Control:
109
+ - private
110
+ Content-Type:
111
+ - multipart/related; type="application/xop+xml";start="<http://tempuri.org/0>";boundary="uuid:df9c2c52-6f6a-4559-ac70-9c4116202651+id=5880";start-info="text/xml"
112
+ body:
113
+ encoding: US-ASCII
114
+ string: ! "\r\n--uuid:df9c2c52-6f6a-4559-ac70-9c4116202651+id=5880\r\nContent-ID:
115
+ <http://tempuri.org/0>\r\nContent-Transfer-Encoding: 8bit\r\nContent-Type:
116
+ application/xop+xml;charset=utf-8;type=\"text/xml\"\r\n\r\n<s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\"><s:Body><s:Fault><faultcode>s:InvalidLogin</faultcode><faultstring
117
+ xml:lang=\"en-GB\">Invalid Login</faultstring></s:Fault></s:Body></s:Envelope>\r\n--uuid:df9c2c52-6f6a-4559-ac70-9c4116202651+id=5880--\r\n"
118
+ http_version:
119
+ recorded_at: Mon, 22 Apr 2013 16:38:43 GMT
120
+ recorded_with: VCR 2.4.0
@@ -0,0 +1,19 @@
1
+ require "bundler"
2
+ Bundler.setup(:default, :test)
3
+
4
+ require "campaign_master"
5
+ require "webmock/rspec"
6
+ require "vcr"
7
+ require "rspec"
8
+
9
+ support_files = File.expand_path("spec/support/**/*.rb")
10
+ Dir[support_files].each { |file| require file }
11
+
12
+ VCR.configure do |config|
13
+ config.cassette_library_dir = "spec/fixtures/vcr_cassettes"
14
+ config.hook_into :webmock
15
+ end
16
+
17
+ RSpec.configure do |config|
18
+ config.order = "random"
19
+ end
@@ -0,0 +1,11 @@
1
+ class ClientSupport
2
+ class << self
3
+ def get_good_client
4
+ CampaignMaster::Client.new('derek', 'password', 123)
5
+ end
6
+
7
+ def get_bad_client
8
+ CampaignMaster::Client.new('derek', 'badsecret', 123)
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ class SubscriberSupport
2
+ class << self
3
+ def get_import_data
4
+ {
5
+ :format => "EmailAddress,First_Name,IsActive\r\n",
6
+ :subscribers => "test@example.org,Test Subscriber,1\r\ntest2@example.org,Test Subscriber 2",
7
+ :delimiter => ","
8
+ }
9
+ end
10
+ end
11
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: campaign_master
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -81,7 +81,28 @@ executables: []
81
81
  extensions: []
82
82
  extra_rdoc_files: []
83
83
  files:
84
+ - .gitignore
85
+ - .travis.yml
86
+ - Gemfile
87
+ - Gemfile.lock
88
+ - README.md
89
+ - campaign_master.gemspec
84
90
  - lib/campaign_master.rb
91
+ - lib/campaign_master/client.rb
92
+ - lib/campaign_master/savon.rb
93
+ - lib/campaign_master/soap_client.rb
94
+ - lib/campaign_master/subscriber.rb
95
+ - spec/campaign_master/client_spec.rb
96
+ - spec/campaign_master/savon_spec.rb
97
+ - spec/campaign_master/soap_client_spec.rb
98
+ - spec/campaign_master/subscriber_spec.rb
99
+ - spec/fixtures/vcr_cassettes/login_import_successful.yml
100
+ - spec/fixtures/vcr_cassettes/login_successful.yml
101
+ - spec/fixtures/vcr_cassettes/login_successful_new_token.yml
102
+ - spec/fixtures/vcr_cassettes/login_unsuccessful.yml
103
+ - spec/spec_helper.rb
104
+ - spec/support/client_support.rb
105
+ - spec/support/subscriber_support.rb
85
106
  homepage: https://github.com/madebymade/campaignmasterrb
86
107
  licenses: []
87
108
  post_install_message: