lib/ews/soap/builders/ews_builder.rb
def build!(opts = {}, &block)
      @nbuild.Envelope(NAMESPACES) do |node|
        node.parent.namespace = parent_namespace(node)
        node.Header {
          set_version_header! opts[:server_version]
          set_impersonation! opts[:impersonation_type], opts[:impersonation_mail]
          set_time_zone_context_header! opts[:time_zone_context]
          yield(:header, self) if block_given?
        }
        node.Body {
          yield(:body, self) if block_given?
        }
      end
      @nbuild.doc
    end
def build!(opts = {}, &block)
      @nbuild.Envelope(NAMESPACES) do |node|
        node.parent.namespace = parent_namespace(node)
        node.Header {
          set_version_header! opts[:server_version]
          set_impersonation! opts[:impersonation_type], opts[:impersonation_mail]
          set_time_zone_context_header! opts[:time_zone_context]
          yield(:header, self) if block_given?
        }
        node.Body {
          yield(:body, self) if block_given?
        }
      end
      @nbuild.doc
    end
Build the SOAP envelope and yield this object so subelements can be built. Once
 you have the EwsBuilder object you can use the nbuild object like shown in the
 example for the Header section. The nbuild object is the underlying
 Nokogiri::XML::Builder object.
 @param [Hash] opts
 @option opts [String] :server_version The version string that should get
   set in the Header. See ExchangeWebService#initialize
 @option opts [Hash] :time_zone_context TimeZoneDefinition. Format: !{id: time_zone_identifier}
 @example
   xb = EwsBuilder.new
   xb.build! do |part, b|
     if(part == :header)
       b.nbuild.MyVar('blablabla')
     else
       b.folder_shape!({:base_shape => 'Default'})
     end
   end