mardi 27 décembre 2016

savon gem SOAP-ERROR: Encoding: Violation of encoding rules

I am using savon version-2 gem for soap requests, and for authorization and few other urls i didnt face problem, but for particular endpoint i need to search the date range from and to which needs to be passed inside item so the problem is first item get replaced by second how do i avoid this

    client = Savon.client(wsdl: "http://ift.tt/2htBM2Y", log_level: :debug, pretty_print_xml: true, log: true)
    session = client.call(:login, message: {username: 'sss', apiKey: 'sss'})
    result = client.call(:sales_order_list, message: {sessionId: session.body[:login_response][:login_return], filters: {filter: {item: {key: 'created_at', value: {key: 'from', value: '2016-12-27 00:00:00'}}, item: {key: 'created_at', value: {key: 'to', value: '2016-12-27 23:59:59'}} }}})

the xml generated is like with the to value only and i get the error SOAP-ERROR: Encoding: Violation of encoding rules

I think overwriting items is the problem How do i send 2 items inside filter

Aucun commentaire:

Enregistrer un commentaire