我正在尝试将运输 API 与我的应用程序集成。我将我的详细信息发送到一个 SOAP 客户端,我收到一个对象数组作为回报,我无法解析。以下是数组。请帮我解析一下:
object(stdClass)#29 (4) {
["Transaction"]=>
object(stdClass)#30 (5) {
["Reference1"]=>
string(0) ""
["Reference2"]=>
string(0) ""
["Reference3"]=>
string(0) ""
["Reference4"]=>
string(0) ""
["Reference5"]=>
string(0) ""
}
["Notifications"]=>
object(stdClass)#31 (0) {
}
["HasErrors"]=>
bool(false)
["Shipments"]=>
object(stdClass)#32 (1) {
["ProcessedShipment"]=>
object(stdClass)#33 (8) {
["ID"]=>
string(10) "42939401"
["Reference1"]=>
string(9) "100000002"
["Reference2"]=>
string(0) ""
["Reference3"]=>
string(0) ""
["ForeignHAWB"]=>
string(0) ""
["HasErrors"]=>
bool(false)
["Notifications"]=>
object(stdClass)#34 (0) {
}
["ShipmentLabel"]=>
object(stdClass)#35 (2) {
["LabelURL"]=>
string(76) "http://content/rpt_cache/9c0d152bbcdc4e739132d2dsda5506.pdf"
["LabelFileContents"]=>
NULL
}
}
}
}
我在$response
变量中接受了这个响应并尝试了以下但这些都不起作用:
echo $order = $response["Shipments"]["ProcessedShipment"]["Reference1"];
echo $hawb = $response["Shipments"]["ProcessedShipment"]["ID"];
echo $barcode = $response["Shipments"]["ProcessedShipment"]["ShipmentLabel"]["LabelURL"];
我不能尝试太多,因为服务没有测试框架,我必须手动取消我创建的所有发货。请告诉我该怎么办。
提前感谢所有帮助。