Sha256: aa96dffb723eaf4e3531219dd1a3395216f18e9080e2928ffffe9ef038579c99

Contents?: true

Size: 1.63 KB

Versions: 41

Compression:

Stored size: 1.63 KB

Contents

require 'savon'
require 'json'
require 'imperituroard/platforms/cps/request_formatter'

class Qps_2

  attr_accessor :formatter_connector, :cps_connector_client

  def initialize(cps_wsdl, cps_endpoint, cps_namespace)
    @formatter_connector = CpsFormatter_2.new
    @cps_connector_client = Savon.client do
      ssl_verify_mode :none
      wsdl cps_wsdl
      endpoint cps_endpoint
      namespace cps_namespace
    end
  end

  #final procedure
  def get_subscriber_msisdn(msisdn)
    response = cps_connector_client.call(:get_subscriber) do
      message(networkId: msisdn)
    end
    answer = JSON.parse(response.to_json)
  end

  def recreate_subscriber(info_from_get_subs)
    mess = formatter_connector.create_subs_for_recreate(info_from_get_subs)
    #tmp = {:subscriber=>{:credential=>[{:networkId=>"375001029830"}, {:networkId=>"Ethernet1/0/9:1933.0 Min_Ljubimova_37_2/0/0/1/0/9", :type=>"User-Name"}], :notification=>[{"destination"=>"etrofimenko@bntu.by", "enabled"=>true, "transport"=>"EMAIL"}, {"destination"=>nil, "enabled"=>false, "transport"=>"SMS"}], :service=>[{"code"=>"FR0000", "enabled"=>true}, {"code"=>"FR10312", "enabled"=>true}, {"code"=>"FR11885", "enabled"=>true}, {"code"=>"FR11873", "enabled"=>true}]}}
    response = cps_connector_client.call(:create_subscriber) do
      message(mess)
    end
    response.to_hash
  end

  #final procedure
  def delete_subscriber(user)
    mess = {:networkId => user, :hardDelete => "true"}
    response = cps_connector_client.call(:delete_subscriber) do
      message(mess)
    end
    access_interface1 = response.to_hash #[:mts_wifi_portal_get_access_int_response][:accessinterface]
  end

end

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
imperituroard-1.1.17 lib/imperituroard/platforms/cps/qps_connector.rb
imperituroard-1.1.15 lib/imperituroard/platforms/cps/qps_connector.rb
imperituroard-1.1.14 lib/imperituroard/platforms/cps/qps_connector.rb
imperituroard-1.1.13 lib/imperituroard/platforms/cps/qps_connector.rb
imperituroard-1.1.12 lib/imperituroard/platforms/cps/qps_connector.rb
imperituroard-1.1.11 lib/imperituroard/platforms/cps/qps_connector.rb
imperituroard-1.1.10 lib/imperituroard/platforms/cps/qps_connector.rb
imperituroard-1.1.9 lib/imperituroard/platforms/cps/qps_connector.rb
imperituroard-1.1.8 lib/imperituroard/platforms/cps/qps_connector.rb
imperituroard-1.1.7 lib/imperituroard/platforms/cps/qps_connector.rb
imperituroard-1.1.5 lib/imperituroard/platforms/cps/qps_connector.rb
imperituroard-1.1.4 lib/imperituroard/platforms/cps/qps_connector.rb
imperituroard-1.1.3 lib/imperituroard/platforms/cps/qps_connector.rb
imperituroard-1.1.2 lib/imperituroard/platforms/cps/qps_connector.rb
imperituroard-1.1.1 lib/imperituroard/platforms/cps/qps_connector.rb
imperituroard-1.1.0 lib/imperituroard/platforms/cps/qps_connector.rb
imperituroard-1.0.9 lib/imperituroard/platforms/cps/qps_connector.rb
imperituroard-1.0.8 lib/imperituroard/platforms/cps/qps_connector.rb
imperituroard-1.0.7 lib/imperituroard/platforms/cps/qps_connector.rb
imperituroard-1.0.5 lib/imperituroard/platforms/cps/qps_connector.rb