Module: Viewpoint::EWS::ConnectionHelper

Included in:
Connection
Defined in:
lib/ews/connection_helper.rb

Overview

This file is part of Viewpoint; the Ruby library for Microsoft Exchange Web Services.

Copyright © 2011 Dan Wanek <dan.wanek@gmail.com>

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Instance Method Summary collapse

Instance Method Details

#init_logging!Object



21
22
23
# File 'lib/ews/connection_helper.rb', line 21

def init_logging!
  @log = Logging.logger[self.class.name.to_s.to_sym]
end

#parse_soap_error(xml) ⇒ Object



26
27
28
29
30
31
32
33
# File 'lib/ews/connection_helper.rb', line 26

def parse_soap_error(xml)
  ndoc = Nokogiri::XML(xml)
  ns = ndoc.collect_namespaces
  err_string  = ndoc.xpath("//faultstring",ns).text
  err_code    = ndoc.xpath("//faultcode",ns).text
  @log.debug "Internal SOAP error. Message: #{err_string}, Code: #{err_code}"
  [err_string, err_code]
end