Class: WSDL::Parser::OperationInfo Private

Inherits:
Object
  • Object
show all
Defined in:
lib/wsdl/parser/operation_info.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Represents a WSDL operation with its binding and port type information.

This class combines information from the binding operation (protocol details) and port type operation (abstract interface) to provide a complete view of an operation that can be invoked.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, binding_operation, port_type_operation, documents:, schemas:, limits:, issues: nil, element_builder: nil) ⇒ OperationInfo

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Creates a new OperationInfo instance.

rubocop:disable Metrics/ParameterLists -- per-operation + build context

Parameters:

  • name (String)

    the operation name

  • binding_operation (BindingOperation)

    the binding operation with protocol details

  • port_type_operation (PortTypeOperation)

    the port type operation with interface details

  • documents (DocumentCollection)

    for resolving message references

  • schemas (Schema::Collection)

    for building element trees

  • limits (Limits)

    resource limits for element building

  • issues (Array, nil) (defaults to: nil)

    optional issues collector for recording build problems

  • element_builder (Object, nil) (defaults to: nil)


25
26
27
28
29
30
31
32
33
34
35
# File 'lib/wsdl/parser/operation_info.rb', line 25

def initialize(name, binding_operation, port_type_operation,
               documents:, schemas:, limits:, issues: nil, element_builder: nil)
  @name = name
  @binding_operation = binding_operation
  @port_type_operation = port_type_operation
  @documents = documents
  @schemas = schemas
  @limits = limits
  @issues = issues
  @element_builder = element_builder
end

Instance Attribute Details

#nameString (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns the name of this operation.

Returns:

  • (String)

    the name of this operation



39
40
41
# File 'lib/wsdl/parser/operation_info.rb', line 39

def name
  @name
end

Instance Method Details

#inputInput

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns the input message definition for this operation.

The input contains the header and body parts that define the structure of request messages.

Returns:

  • (Input)

    the input message definition



67
68
69
70
71
72
73
74
# File 'lib/wsdl/parser/operation_info.rb', line 67

def input
  @input ||= Input.new(
    @binding_operation, @port_type_operation,
    documents: @documents, schemas: @schemas,
    limits: @limits, issues: @issues,
    element_builder: @element_builder
  )
end

#input?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns whether the binding operation defines an input element.

Returns:

  • (Boolean)

    true if the binding has an ++ element



99
100
101
# File 'lib/wsdl/parser/operation_info.rb', line 99

def input?
  @binding_operation.input?
end

#input_styleString

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns the input style for this operation.

The style is a combination of the binding style and use attribute, such as 'document/literal' or 'rpc/literal'.

Returns:

  • (String)

    the input style (e.g., 'document/literal')



123
124
125
# File 'lib/wsdl/parser/operation_info.rb', line 123

def input_style
  "#{@binding_operation.style}/#{@binding_operation.input_body[:use]}"
end

#outputOutput?

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns the output message definition for this operation.

The output contains the header and body parts that define the structure of response messages. Returns nil for one-way operations that have no output message.

Returns:

  • (Output, nil)

    the output message definition, or nil for one-way operations



83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/wsdl/parser/operation_info.rb', line 83

def output
  return @output if defined?(@output)

  return unless @port_type_operation.output

  @output = Output.new(
    @binding_operation, @port_type_operation,
    documents: @documents, schemas: @schemas,
    limits: @limits, issues: @issues,
    element_builder: @element_builder
  )
end

#output_styleString?

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns the output style for this operation.

The style is a combination of the binding style and use attribute, such as 'document/literal' or 'rpc/literal'. Returns nil for one-way operations that have no output message.

Returns:

  • (String, nil)

    the output style, or nil for one-way operations



134
135
136
137
138
139
# File 'lib/wsdl/parser/operation_info.rb', line 134

def output_style
  use = @binding_operation.output_body[:use]
  return unless use

  "#{@binding_operation.style}/#{use}"
end

#rpc_input_namespaceString?

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns the RPC input namespace from the binding's input body.

Returns:

  • (String, nil)

    the namespace URI, or nil if not specified



106
107
108
# File 'lib/wsdl/parser/operation_info.rb', line 106

def rpc_input_namespace
  @binding_operation.input_body[:namespace]
end

#rpc_output_namespaceString?

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns the RPC output namespace from the binding's output body.

Returns:

  • (String, nil)

    the namespace URI, or nil if not specified



113
114
115
# File 'lib/wsdl/parser/operation_info.rb', line 113

def rpc_output_namespace
  @binding_operation.output_body[:namespace]
end

#soap_actionString?

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns the SOAP action for this operation.

The SOAP action is typically used as an HTTP header value to indicate the intent of the SOAP request.

Returns:

  • (String, nil)

    the SOAP action URI, or nil if not specified



47
48
49
# File 'lib/wsdl/parser/operation_info.rb', line 47

def soap_action
  @binding_operation.soap_action
end

#soap_versionString?

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns the SOAP version for this operation.

Returns:

  • (String, nil)

    the SOAP version ('1.1' or '1.2'), or nil if unknown



54
55
56
57
58
59
# File 'lib/wsdl/parser/operation_info.rb', line 54

def soap_version
  case @binding_operation.soap_namespace
  when NS::WSDL_SOAP_1_1 then '1.1'
  when NS::WSDL_SOAP_1_2 then '1.2'
  end
end