From 70dc788f4c325ad9653f06d3844bf1ec45c08e3d Mon Sep 17 00:00:00 2001 From: Derek Wright Date: Tue, 3 Feb 2015 09:07:45 -0500 Subject: [PATCH] Fix for issue #54 update to lib/wasabi/parser.rb to ignore message that doesn't have the currently defined port_message_type --- lib/wasabi/parser.rb | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/wasabi/parser.rb b/lib/wasabi/parser.rb index ad9756f..a777828 100644 --- a/lib/wasabi/parser.rb +++ b/lib/wasabi/parser.rb @@ -257,8 +257,10 @@ def input_for(operation) end message = @messages[port_message_type] - port_message_part = message.element_children.find do |node| - soap_body_parts.nil? ? (node.name == 'part') : ( node.name == 'part' && node['name'] == soap_body_parts) + if !message.nil? + port_message_part = message.element_children.find do |node| + soap_body_parts.nil? ? (node.name == 'part') : ( node.name == 'part' && node['name'] == soap_body_parts) + end end if port_message_part && port_element = port_message_part.attribute('element') @@ -315,8 +317,10 @@ def output_for(operation) end message = @messages[port_message_type] - port_message_part = message.element_children.find do |node| - soap_body_parts.nil? ? (node.name == 'part') : ( node.name == 'part' && node['name'] == soap_body_parts) + if !message.nil? + port_message_part = message.element_children.find do |node| + soap_body_parts.nil? ? (node.name == 'part') : ( node.name == 'part' && node['name'] == soap_body_parts) + end end if port_message_part && port_element = port_message_part.attribute('element')