0

I have a third party application and output of this application is an request xml which needs to be passed in to webservice (WSDL)

I need to do integration testing where i will be getting this request xml.

how can i pass this request xml using savon in Ruby ? is there anyother way where we can pass request xml and get the output in response xml

i tried using soapui and it works but i am looking for native ruby solution

testerBDD
  • 255
  • 3
  • 18
  • client = Savon.client(wsdl: 'globalweather.wsdl', ssl_verify_mode: :none, ssl_version: :TLSv1) response = client.call(:get_cities_by_country, xml: " United states ") this is working but if i want to use same request from XML /request.xml, how do i read it – testerBDD Sep 26 '17 at 18:27
  • Possible duplicate of [Sending raw XML using Savon 2](https://stackoverflow.com/questions/21913449/sending-raw-xml-using-savon-2) – Steffen Roller Oct 08 '17 at 15:43

1 Answers1

2

Hello I found the answer and below is the code

Then (/^I test wsdl$/) do require 'savon'

require 'nokogiri'

xml_file = File.read("/test.xml")

client = Savon.client(wsdl: '/globalweather.wsdl', ssl_verify_mode: :none, ssl_version: :TLSv1)

response = client.call(:get_cities_by_country, xml: xml_file)
puts response.to_xml
print response.to_xml

end

testerBDD
  • 255
  • 3
  • 18