0

Well I'm using Savon to consume a wash_out SOAP server.

Everything seems all right because I can send my SOAP messages and the server can save them into a mysql database.

My problem comes after my client send the request because I'm receiving an HTTP error (406): coming from the request that looks like this:

response = client.call(:crear_articulo) do
  message texto: ":3", titulo: ":'("
end

In the server I have the following code: soap_action "crear_articulo", :args => { :texto => :string, :titulo => :string }, :return => :string

And the method that is handling the request is like this:

def crear_articulo
  @ar = Articulo.new
  @ar.titulo = params[:titulo]
  @ar.texto = params[:texto]
  if @ar.save
    render :soap => "Correcto"
  else
    render :soap => "Error"
  end
end

I guess the error is in the server but, I can't see where it is. Thank you very much.

Uriel Hernández
  • 731
  • 3
  • 9
  • 23
  • you can read parameters from a soap request directly from the `params` variable? –  Apr 09 '13 at 00:00
  • I think I can because as I mention, the logic is working because my database is being filled. And this is an example from the wash_out documentation: def concat render :soap => (params[:a] + params[:b]) end – Uriel Hernández Apr 09 '13 at 00:04
  • cool gem. i'd suspect the client, because 406 means that the client won't accept the `application/soap+xml` MIME type –  Apr 09 '13 at 00:08
  • Any suggestion about how to fix it? Thank you. – Uriel Hernández Apr 09 '13 at 00:10
  • https://github.com/savonrb/savon/blob/master/lib/savon/request.rb seems to suggest that you'll need to set `@globals[:soap_version] = 2` –  Apr 09 '13 at 06:54

0 Answers0