0

我需要将我的rails 2应用程序与3dCart API集成。我想请求获取商店中的订单数量。为此,我正在关注http://api.3dcart.com/cart.asmx?op=getOrderCount

我创建了以下 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' })

我的问题是,响应虽然是

网络::HTTP OK 200 OK readbody=true

它包含以下错误节点:

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

1 回答 1

3

商店 URL 不应该包含https前缀,它应该只是

echtest3d.3dcartstores.com/
于 2013-07-15T13:06:03.107 回答