http://mountainstream.ms/so1.png
http://mountainstream.ms/so2.png
http://mountainstream.ms/so3.png
我尝试使用Ruby实例变量将数据保存在哈希中。它看起来像这样:
@@order[:pickupDate] = { pickupDate: '', readyTime: '08:00', closeTime: '20:00'}
@@order[:service] = { shipper: shipper, packaging: packaging }
package = [weight, length, height, width, shape, packaging, packageValue]
@@order[:packages] = package
@@order[:packageServiceOptions] = { insurance: insurance, cod: cod, description: description, remarks: remarks }
@@order[:inpostMachines] = { senderMachine: '', recipientMachine: '', alternativeRecipientMachine: '' }
@@order[:sender] = { contact: { companyName: sender_company_name,
personName: sender_name,
phoneNumber: sender_phone,
emailAddress: sender_email
},
address: { street: sender_street,
postalCode: sender_po,
city: sender_city,
stateOrProvinceCode: sender_state,
country: sender_country
}}
@@order[:recipient] = { contact: { companyName: rec_company_name,
personName: rec_name,
phoneNumber: rec_phone,
emailAddress: rec_email
},
address: { street: rec_street,
postalCode: rec_po,
city: rec_city,
stateOrProvinceCode: rec_state,
country: rec_country
}}
response = @@client.call(:rate_shipment, message: { shipementToEvaluate: @@order,
apiKey: apiKey, sessionId: @@sessionId})
发送时,回复包含错误:
`<h1>CException</h1> <p>Argument 1 passed to ShipmentValidator::__construct() must be an instance of Shipment, null given, called in /api/protected/controllers/ShipServiceController.php on line 252 and defined</p>`
我试图重新排列哈希无济于事,我在这里做错了什么?