2013-07-15 43 views
0

我需要將我的rails 2應用程序與3dCart API集成。我想提出請求以獲得商店中的訂單數量。 要做到這一點,我下面http://api.3dcart.com/cart.asmx?op=getOrderCount3dCart API與rails2集成

我創建的跟隨着XML文件

<?xml version="1.0" encoding="utf-8"?> 
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  xmlns:xsd="http://www.w3.org/2001/XMLSchema"> 
    <soap:Body> 
    <getOrderCount xmlns="http://3dcart.com/"> 
     <storeUrl>https://echtest3d.3dcartstores.com/</storeUrl> 
     <userKey>MY API KEY</userKey> 
    </getOrderCount> 
    </soap:Body> 

那麼我張貼如下

http = Net::HTTP.new("api.3dcart.com") 
http.use_ssl = false 
http.post("/cart.asmx", xml_file, { 
       'Content-Type' => 'text/xml; charset=utf-8', 
       'Content-Length' => "#{xml_file.length}", 
       'SOAPAction' => 'http://3dcart.com/getOrderCount' }) 

我的問題是,在雖然是

的Net :: HTTP OK 200 OK readbody =真

它包含以下錯誤節點:

error trying to get data from the store. Technical description: The remote name could not be resolved: 'https' 

回答

3

的商店網址不應包含https前綴,它應該只是

echtest3d.3dcartstores.com/