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

Could not reach the SOAP API action through washout gem #270

Open
bhiseweb opened this issue Feb 4, 2020 · 1 comment
Open

Could not reach the SOAP API action through washout gem #270

bhiseweb opened this issue Feb 4, 2020 · 1 comment

Comments

@bhiseweb
Copy link

bhiseweb commented Feb 4, 2020

I am trying to integrate the salesforce with my rails 6 application with the help of Washout (0.12.0), and Savon The issue is that I am not able to reach any action within the web service I have created by Washout and Savon gem. I think there may be some with the url/routes.
Further code related details are mentioned follows:

require 'savon'
require 'rubygems'
require 'net/https'
require 'errors'
require 'wash_out'

class Api::MyController < ActionController::Base
  soap_service namespace: 'urn:WashOut'

  before_action :dump_parameters

  def dump_parameters
    logger.info "Inside dump parameters"
    logger.info "Parameters: #{request}"
    logger.info "Parameters: #{request.raw_post}"
    my_params = params[:my_params]
    Rails.logger.info "End of dump paramaters"
  end
end

When the request is generated I cannot reach this controller or any action within it. The error I am getting after generating request from salesforce to my rails application.

Started POST "/api/my_controller/action" for 80.194.71.208 at 2020-02-04 18:15:43 +0530
Cannot render console from 80.194.71.208! Allowed networks: 127.0.0.0/127.255.255.255, ::1
Processing by Api::MyController#_invalid_action as HTML
Completed 500 Internal Server Error in 2ms (ActiveRecord: 0.0ms | Allocations: 1236)



NoMethodError (undefined method `[]' for nil:NilClass):

wash_out (0.11.0) lib/wash_out/dispatcher.rb:34:in `_map_soap_parameters'
activesupport (6.0.2.1) lib/active_support/callbacks.rb:429:in `block in make_lambda'

And routes are as follows:

namespace :api do
  wash_out :my_controller
end

As I further debugged I am not getting request.env['wash_out.soap_action'] proper.
Its something "http://tempuri.org/XYZ/New"

@exosty
Copy link

exosty commented Feb 19, 2020

@bhiseweb Try to reload WSDL in your SOAP client

In my case I just recreated project in SoapUI

Error occurs if you changed action name in controller and since that time WSDL is different

Here action_spec returns nil:
https://github.com/inossidabile/wash_out/blob/v0.12.0/lib/wash_out/dispatcher.rb#L34

If you go to method definition you will see it just can not find SOAPAaction from request which was assembled using old WSDL:
https://github.com/inossidabile/wash_out/blob/v0.12.0/lib/wash_out/dispatcher.rb#L239

Hope it hepls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants