I start working on ruby very recently. i written a small code for SOAP
client request and response using curb gem. But i am getting some error
in response XML.
Code:
require ‘curb’
c = Curl::Easy.new('http://api.abc.com/service.asmx?wsdl&apikey='+key)
c.multipart_form_post = true
c.http_post(Curl::PostField.content(‘SOAPAction’,
‘http://api.abc.com/GetServices’))
c.http_post(Curl::PostField.content(‘Content-Type’,
‘application/soap+xml; charset=utf-8’))
c.http_post(Curl::PostField.content(‘Content-Length’, ‘200’))
c.http_post(Curl::PostField.file(‘xml’, ‘/path/data.xml’))
puts c.body_str
Error:
<soap:Text xml:lang=“en”>Server was unable to process request. —>
Data at the root level is invalid. Line 1, position 1.</soap:Text>
Thanks in advance