2011-09-24 59 views
2

我在我的RoR應用程序中使用了Savon。在Savon中分析日期和時間時丟失xml數據

這是我的電話到服務:

client = Savon::Client.new(MY_SOAP_CLIENT) 

response = client.request :wsdl, :get_history do 
    soap.body = "<startDate>2011-09-23</startDate><endDate>2011-09-24</endDate><userId>3</userId>" 
end 

而且我得到XML中的下一個響應:

<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\"> 
<soapenv:Body xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\"> 
<resMessage xmlns=\"http://xxx-xxx.xxx.edu/xxx/\"> 
    <result>date=2011-09-23?amount=13.00?time=08:50:38?user=a00123?type=transfer</result> 
    <result>date=2011-09-23?amount=3.00?time=08:51:27?user=a0?type=transfer</result> 
    <result>date=2011-09-23?amount=20.00?time=09:49:00?user=a0?type=transfer</result> 
</resMessage></soapenv:Body></soapenv:Envelope> 

但是,主要的問題是,當我打電話response.to_hash我只得到日期對象部分:

=> [星期五,2011年9月23日,星期二,2011年9月23日,星期二,2011年9月23日]

這對日期很好,但結果的其他部分缺失:數量,時間,用戶和類型。另外,如果我叫response.body我一直得到了相同的結果:

=> {:res_message => {:結果=>【週五,23 2011年9月,星期五,2011年9月23日,星期五, 23 2011年9月, 2011年9月23日,星期五,2011年9月23日星期五], :@ xmlns =>「http://xxx-xxx.xxx.edu/xxx/」}, :「@ xmlns:soapenv」=>「http: //schemas.xmlsoap.org/soap/envelope/「}

我沒有找到這個位置也不是薩翁問題

由於該解決方案提前

回答