soap - Ruby SAVON gem errors in making request -
i'm trying create appears pretty straight forwards soap request, 1 works in soapui when execute ruby code, 'raise_soap_and_http_errors!' exception executing request.
here's code - document referenced in wsdl_path works in soapui create authenticate request.
require 'savon' wsdl_path = 'xxxx_soap_interface.wsdl' client = savon.client( :wsdl => wsdl_path, :ssl_verify_mode => :none, :raise_errors => true, # false if don't want see exceptions pretty_print_xml: true) response = client.call( :authenticate, message: {:partnername => 'xxxx', :username => 'xxxxxx', :password => 'xxxxx'} ) puts response the error is:
savon/response.rb:85:in `raise_soap_and_http_errors!': (soap- env:server) exception executing request (savon::soapfault) c:/railsinstaller/ruby1.9.3/lib/ruby/gems/1.9.1/gems/savon-2.4.0/lib/savon/response.rb:14:in `initialize' c:/railsinstaller/ruby1.9.3/lib/ruby/gems/1.9.1/gems/savon-2.4.0/lib/savon/operation.rb:64:in `new' c:/railsinstaller/ruby1.9.3/lib/ruby/gems/1.9.1/gems/savon-2.4.0/lib/savon/operation.rb:64:in `create_response' c:/railsinstaller/ruby1.9.3/lib/ruby/gems/1.9.1/gems/savon-2.4.0/lib/savon/operation.rb:55:in `call' c:/railsinstaller/ruby1.9.3/lib/ruby/gems/1.9.1/gems/savon-2.4.0/lib/savon/client.rb:36:in `call' xxx_soap.rb:15:in `<main>' i'm running ruby 1.9, have ideas on create work?
edit: wsdl_path variable, when used create savon client, works. i'm able create client , execute client.operations , operations soap service. request failing.
edit: after adding helpful logging code below, getting back:
<soap-env:envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:xsd="http://www.w3.org/2001/xmlschema" xmlns:common="urn:xxx-com:cloud:common" xmlns:finsvc="urn:xxx-com:cloud:finsvc" xmlns:finsvc-13-6-0="urn:xxx-com:cloud:finsvc:13.6.0"> <soap-env:body soap-env:encodingstyle="http://schemas.xmlsoap.org/soap/encoding/"> <soap-env:fault> <faultcode>soap-env:server</faultcode> <faultstring>exception executing request</faultstring> <detail> <operationresult> <errorcode>101</errorcode> <errormessage>soap error 44 (soap 1.1 fault: soap-env:client [no subcode] "validation constraint violation: occurrence v iolation in element 'username'" detail: [no detail] )</errormessage> </operationresult> </detail> </soap-env:fault> </soap-env:body> </soap-env:envelope> no matter order set parameters in or if utilize camelcase or not, first parameter specified in message throws above error.
wsdl_path should total url, http://domain.name/.../soap.wsdl.
ruby soap savon
No comments:
Post a Comment