Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Original operation name and document style operations #67

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions lib/wasabi/parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def parse_operations
# TODO: check for soap namespace?
soap_operation = operation.element_children.find { |node| node.name == 'operation' }
soap_action = soap_operation['soapAction'] if soap_operation

soap_document = soap_operation['style'] if soap_operation
if soap_action
soap_action = soap_action.to_s
action = soap_action && !soap_action.empty? ? soap_action : name
Expand All @@ -151,7 +151,12 @@ def parse_operations
namespace_id, input = input_for(operation)

# Store namespace identifier so this operation can be mapped to the proper namespace.
@operations[snakecase_name] = { :action => action, :input => input, :output => output, :namespace_identifier => namespace_id}
@operations[snakecase_name] = { :name =>name, :action => action, :input => input, :output => output, :namespace_identifier => namespace_id}
elsif soap_document
#if there is no soap_action under operation element maybe operation's style is document and still have input & output
namespace_id, output = output_for(operation)
namespace_id, input = input_for(operation)
@operations[name.snakecase.to_sym] = { :name =>name, :action => name, :input => input, :output => output, :namespace_identifier => namespace_id}
elsif !@operations[snakecase_name]
@operations[snakecase_name] = { :action => name, :input => name }
end
Expand Down