2011-07-29 5 views
0

나는 최근에 루비 작업을 시작합니다. 나는 연석 보석을 사용하여 SOAP 클라이언트 요청 및 응답을위한 작은 코드를 작성했습니다. 그러나 응답 XML에서 일부 오류가 발생합니다.ruby에서 연석을 사용하여 soap에서 응답을 얻으십시오

코드 :

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('rovi', '/path/data.xml')) 
puts c.body_str 

오류 : 사전

에서

<soap:Text xml:lang="en">Server was unable to process request. ---&gt; Data at the root level is invalid. Line 1, position 1.</soap:Text> 

감사

+0

시도 savonrb.com - (귀하의) 서비스에 액세스하지 않고 요청 작업을 할 수있는 방법이 없습니다. – rubiii

답변

관련 문제