Need help translating a SOAPUI request into Ruby code using Savon Stone

I am working on a SOAP API that has two operations, and each operation requires API keys and many other attributes. Thus, I was able to make a request through SOAPUI, but I had problems translating this code into a ruby ​​code using shroud jam (version 2).

Here is a screenshot of the searchTours request.

enter image description here

Now, how do I translate it into ruby ​​code using Savon? I tried to follow, but it did not work.

client = Savon.client(wsdl: 'url goes here..')

client.operations #=> [:tour_details_full, :search_records]

message = {security_key: "SECURITYKEYS", attributes_one: "ValueOne", attribute_two: IntegerValue}

response = client.call(:search_records, message: message)

Error message:

Savon :: SOAPFault: (S: Client) Unable to find the submit method for {url_here} SearchRecords

+4
source share
2 answers

:

  • SoapUI.
  • SoapUI.
  • , .
  • , Savon.
  • .
0

- :

class SearchTours
  extend Savon::Model
  client wsdl: 'your url',
    namespaces: {
      ...
      'xmlns:soapenv' => 'http://schemas.xmlsoap.org/soap/envelope/',
      ....
      ...#your namespacecs
    }

  operations :tour_details_full, :search_records

  def self.tour_details_full
    builder = Builder::XmlMarkup.new()#describe your request params
    super message: builder
  end

  def self.search_records
    builder = Builder::XmlMarkup.new()#describe your request params
    super message: builder
  end

end

#then you can call
SearchTours.search_records #=> []

-, wsdl

0

All Articles