diff --git a/lib/wasabi/parser.rb b/lib/wasabi/parser.rb index ce7a832..796ed0c 100644 --- a/lib/wasabi/parser.rb +++ b/lib/wasabi/parser.rb @@ -269,9 +269,9 @@ def input_output_for(operation, input_output) # Fall back to the name of the binding operation if message_type - [message_ns_id, message_type] + [message_ns_id, operation_name] else - [port_message_ns_id, port_message_type] + [port_message_ns_id, operation_name] end else [nil, operation_name] diff --git a/spec/wasabi/document/authentication_spec.rb b/spec/wasabi/document/authentication_spec.rb index 265ba79..6f9447e 100644 --- a/spec/wasabi/document/authentication_spec.rb +++ b/spec/wasabi/document/authentication_spec.rb @@ -15,7 +15,7 @@ its(:operations) do should == { - :authenticate => { :input => "authenticate", :output => "authenticateResponse", :action => "authenticate", :namespace_identifier => "tns" } + :authenticate => { :input => "authenticate", :output => "authenticate", :action => "authenticate", :namespace_identifier => "tns" } } end diff --git a/spec/wasabi/document/multiple_namespaces_spec.rb b/spec/wasabi/document/multiple_namespaces_spec.rb index 0209bfa..7117530 100644 --- a/spec/wasabi/document/multiple_namespaces_spec.rb +++ b/spec/wasabi/document/multiple_namespaces_spec.rb @@ -14,7 +14,7 @@ it { should have(1).operations } its(:operations) do - should == { :save => { :input => "Save", :output=>"SaveResponse", :action => "http://example.com/actions.Save", :namespace_identifier => "actions", :parameters => { :article => { :name => "article", :type => "Article" } } } } + should == { :save => { :input => "Save", :output=>"Save", :action => "http://example.com/actions.Save", :namespace_identifier => "actions", :parameters => { :article => { :name => "article", :type => "Article" } } } } end its(:type_namespaces) do diff --git a/spec/wasabi/document/namespaced_actions_spec.rb b/spec/wasabi/document/namespaced_actions_spec.rb index daf83c6..daa33f4 100644 --- a/spec/wasabi/document/namespaced_actions_spec.rb +++ b/spec/wasabi/document/namespaced_actions_spec.rb @@ -15,9 +15,9 @@ its(:operations) do should include( - { :delete_client => { :input => "Client.Delete", :output => "Client.DeleteResponse", :action => "http://api.example.com/api/Client.Delete", :namespace_identifier => "tns" } }, - { :get_clients => { :input => "User.GetClients", :output => "User.GetClientsResponse", :action => "http://api.example.com/api/User.GetClients", :namespace_identifier => "tns" } }, - { :get_api_key => { :input => "User.GetApiKey", :output => "User.GetApiKeyResponse", :action => "http://api.example.com/api/User.GetApiKey", :namespace_identifier => "tns" } } + { :delete_client => { :input => "DeleteClient", :output => "DeleteClient", :action => "http://api.example.com/api/Client.Delete", :namespace_identifier => "tns" } }, + { :get_clients => { :input => "GetClients", :output => "GetClients", :action => "http://api.example.com/api/User.GetClients", :namespace_identifier => "tns" } }, + { :get_api_key => { :input => "GetApiKey", :output => "GetApiKey", :action => "http://api.example.com/api/User.GetApiKey", :namespace_identifier => "tns" } } ) end diff --git a/spec/wasabi/document/no_namespace_spec.rb b/spec/wasabi/document/no_namespace_spec.rb index 70750ce..30474ed 100644 --- a/spec/wasabi/document/no_namespace_spec.rb +++ b/spec/wasabi/document/no_namespace_spec.rb @@ -15,9 +15,9 @@ its(:operations) do should include( - { :get_user_login_by_id => { :input => "GetUserLoginById", :output => "GetUserLoginByIdResponse", :action => "/api/api/GetUserLoginById", :namespace_identifier => "typens" } }, - { :get_all_contacts => { :input => "GetAllContacts", :output =>"GetAllContactsResponse", :action => "/api/api/GetAllContacts", :namespace_identifier => "typens" } }, - { :search_user => { :input => "SearchUser", :output =>"SearchUserResponse", :action => "/api/api/SearchUser", :namespace_identifier => nil } } + { :get_user_login_by_id => { :input => "GetUserLoginById", :output => "GetUserLoginById", :action => "/api/api/GetUserLoginById", :namespace_identifier => "typens" } }, + { :get_all_contacts => { :input => "GetAllContacts", :output =>"GetAllContacts", :action => "/api/api/GetAllContacts", :namespace_identifier => "typens" } }, + { :search_user => { :input => "SearchUser", :output =>"SearchUser", :action => "/api/api/SearchUser", :namespace_identifier => nil } } ) end diff --git a/spec/wasabi/document/savon295_spec.rb b/spec/wasabi/document/savon295_spec.rb index cd97e11..c8b8375 100644 --- a/spec/wasabi/document/savon295_spec.rb +++ b/spec/wasabi/document/savon295_spec.rb @@ -7,7 +7,7 @@ its(:operations) do should include( - { :sendsms => { :input => "sendsmsRequest", :output => "sendsmsResponse", :action => "sendsms", :namespace_identifier => "tns" } } + { :sendsms => { :input => "sendsms", :output => "sendsms", :action => "sendsms", :namespace_identifier => "tns" } } ) end diff --git a/spec/wasabi/parser/no_message_parts_spec.rb b/spec/wasabi/parser/no_message_parts_spec.rb index 313cd5e..1985aba 100644 --- a/spec/wasabi/parser/no_message_parts_spec.rb +++ b/spec/wasabi/parser/no_message_parts_spec.rb @@ -1,7 +1,7 @@ -require "spec_helper" +require 'spec_helper' describe Wasabi::Parser do - context "with: no_message_parts.wsdl" do + context 'with: no_message_parts.wsdl' do subject do parser = Wasabi::Parser.new Nokogiri::XML(xml) @@ -11,16 +11,16 @@ let(:xml) { fixture(:no_message_parts).read } - it "falls back to using the message type in the port element" do + it 'falls back to using the message type in the port element' do # Operation's input has no part element in the message, so using the message type. - subject.operations[:save][:input].should == "SaveSoapIn" + subject.operations[:save][:input].should == 'Save' # Operation's output has part element in the message, so using part element's type. - subject.operations[:save][:output].should == "SaveResponse" + subject.operations[:save][:output].should == 'Save' end - it "falls back to using the namespace ID in the port element" do - subject.operations[:save][:namespace_identifier].should == "actions" + it 'falls back to using the namespace ID in the port element' do + subject.operations[:save][:namespace_identifier].should == 'actions' end end end