View Savon Request XML without Sending to Server

Using Savon 2 I do it this way, write a method that return the request body from the client.

 client = Savon::Client.new(....)

this is not mentioned in the documentation

  def get_request
     # list of operations can be found using client.operations
     ops = client.operation(:action_name_here)

     # build the body of the xml inside the message here        
     ops.build(message: { id: 42, name: "Test User", age: 20 }).to_s
  end

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)