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')