我承认我对 SOAP 和 Savon 都是新手,但是我让它与另一个服务一起工作,但是这个让我很困惑。
WSDL 在这里: http ://stg-wholesale.carsdirect.com/ws/services/Ping?WSDL
完成后的文档应如下所示:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<dealerPing xmlns="http://wholesale.carsdirect.com">
<request>
<partner>
<pricePlan>integer</pricePlan>
<id>integer</id>
</partner>
<vehicle>
<year>integer</year>
<make>string</make>
<model>string</model>
<trim>string</trim>
</vehicle>
<zipcode>integer</zipcode>
</request>
</dealerPing>
</soap:Body>
</soap:Envelope>
如果有人可以接近生成这样的文档或给我一些指示,我将不胜感激。
我尝试做类似的事情:
client = Savon::Client.new{|wsdl| wsdl.document = @cp.wsdl}
@response = client.dealer_ping do |soap|
...
end
但是,我收到了这个错误:未定义的方法 `dealer_ping' for #
我几乎被困在这一点上。我对这个等式的两个部分都缺乏了解。
谢谢。