我在与Tecdoc项目合作。在这里了解Tecdochttp://webservicepilot.tecdoc.net/pegasus-2-0/。
所以在这一页http://webservicepilot.tecdoc.net/pegasus-2-0/test2/index.html
在下拉菜单中,您将找到函数getvehiclebyids()、getvehiclebyids2()、getvehiclebyids2stringlist()和getvehiclebyidsstringlist()。
在上面的函数中,您将找到一个carids字段,其数据类型为longlist(对于前两个函数)或stringlist(对于其他两个函数)。
现在,当我从php调用这个函数时,我必须在lonllist或stringlist数据类型中传递这个字段的参数,这在php中是不可用的,是的,知道这个任务通常使用php数组。但它在这里不起作用。
这是密码…
<?php
$url ="http://webservicepilot.tecdoc.net/pegasus-2-0/wsdl/TecdocToCat";
$trace = array('trace' => 1);
$client = new SoapClient($url, $trace);
$request_array = array(
'country'=>'pt',
'countryUserSetting'=>'CH',
'lang'=>'pt',
'motorCodes'=>true,
'provider'=>'452',
'vehicleTerms'=>true,
'carIds'=>1116,
'passengerCarDetails'=>true
);
echo "<pre>";
$responce = $client->getVehicleByIds($request_array);
print_r($responce);
?>
注意:在第一个链接我提供了一些文件。
请参阅interfacectservice.pdf了解每个功能数据类型的详细信息研究。
请帮帮我。
最佳答案
我可以看到如下输出。
stdClass Object
(
[data] => stdClass Object
(
[array] => Array
(
)
[empty] => 1
)
[status] => 200
[statusText] =>
)
再次打招呼,
我已经尝试过CURL……通过使用SOAPCube,LangListCARID有问题。所以我们可以处理curl请求。
得到了下面的输出。
阵列
(
[数据]=>数组
(
[阵列]=>阵列
(
[阵列]=>阵列
(
[0]=>数组
(
[Carid]=>1116个
[汽车代码]=>阵列
(
[阵列]=>阵列
(
[阵列]=>阵列
(
[汽车代码]=>DZ
)
)
[empty] => false
)
[passengerCarDetails] => Array
(
[brakeSystem] => Hidráulico
[constructionType] => três volumes
[cylinder] => 4
[cylinderCapacityCcm] => 1781
[cylinderCapacityLiter] => 180
[fuelType] => Gasolina
[fuelTypeProcess] => Injecção no colector de admissão/carburador
[impulsionType] => Tracção dianteira
[manuName] => AUDI
[modelName] => 80 (89, 89Q, 8A, B3)
[motorType] => Otto
[powerHP] => 112
[powerKW] => 82
[typeName] => 1.8 E
[typeNumber] => 1116
[valves] => 2
[yearOfConstructionFrom] => 198606
[yearOfConstructionTo] => 199108
)
[vehicleDetails] => Array
(
[axisConfiguration] => Array
(
[@value] =>
[@attributes] => Array
(
[nil] => true
)
)
[carId] => 1116
[ccmTech] => 1781
[constructionType] => três volumes
[manuId] => 5
[modId] => 31
[powerHpFrom] => 112
[powerHpTo] => 112
[powerKwFrom] => 82
[powerKwTo] => 82
[tonnage] => Array
(
[@value] =>
[@attributes] => Array
(
[nil] => true
)
)
[yearOfConstrFrom] => 198606
[yearOfConstrTo] => 199108
)
[vehicleTerms] => Array
(
[carId] => 1116
[carType] => 1.8 E
[manuId] => 5
[manuName] => AUDI
[modId] => 31
[modelName] => 80 (89, 89Q, 8A, B3)
)
)
[1] => Array
(
[carId] => 1117
[motorCodes] => Array
(
[array] => Array
(
[array] => Array
(
[motorCode] => SD
)
)
[empty] => false
)
[passengerCarDetails] => Array
(
[brakeSystem] => Hidráulico
[constructionType] => três volumes
[cylinder] => 4
[cylinderCapacityCcm] => 1847
[cylinderCapacityLiter] => 180
[fuelType] => Gasolina
[fuelTypeProcess] => Injecção no colector de admissão/carburador
[impulsionType] => Tracção dianteira
[manuName] => AUDI
[modelName] => 80 (89, 89Q, 8A, B3)
[motorType] => Otto
[powerHP] => 113
[powerKW] => 83
[typeName] => 1.8
[typeNumber] => 1117
[valves] => 2
[yearOfConstructionFrom] => 198609
[yearOfConstructionTo] => 198807
)
[vehicleDetails] => Array
(
[axisConfiguration] => Array
(
[@value] =>
[@attributes] => Array
(
[nil] => true
)
)
[carId] => 1117
[ccmTech] => 1847
[constructionType] => três volumes
[manuId] => 5
[modId] => 31
[powerHpFrom] => 113
[powerHpTo] => 113
[powerKwFrom] => 83
[powerKwTo] => 83
[tonnage] => Array
(
[@value] =>
[@attributes] => Array
(
[nil] => true
)
)
[yearOfConstrFrom] => 198609
[yearOfConstrTo] => 198807
)
[vehicleTerms] => Array
(
[carId] => 1117
[carType] => 1.8
[manuId] => 5
[manuName] => AUDI
[modId] => 31
[modelName] => 80 (89, 89Q, 8A, B3)
)
)
)
)
[empty] => false
)
)
下面是使用卷曲来获得响应的代码。
$soap_request = "<?xml version=\"1.0\"?>\n";
$soap_request .= '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns2="http://path- to/schemas" xmlns:urn="urn:axis.server.cat.tecdoc.net" xmlns:car="http://carselection.datatype.tocinterface.cat.tecdoc.net" xmlns:dat="http://datatype.cat.tecdoc.net" xmlns:tec="http://webservicepilot.tecdoc.net/pegasus-2-0/services/TecdocToCatWL">
<soapenv:Header/>
<soapenv:Body>
<urn:getVehicleByIds>
<urn:in0>
<car:carIds>
<dat:array>
<tec:item>1116</tec:item>
<tec:item>1117</tec:item>
</dat:array>
</car:carIds>
<car:country>pt</car:country>
<car:countryUserSetting>CH</car:countryUserSetting>
<car:lang>pt</car:lang>
<car:motorCodes>true</car:motorCodes>
<car:passengerCarDetails>true</car:passengerCarDetails>
<car:provider>292</car:provider>
<car:vehicleTerms>true</car:vehicleTerms>
</urn:in0>
</urn:getVehicleByIds>
</soapenv:Body>
</soapenv:Envelope>';
$header = array(
"Content-type: text/xml;charset=\"utf-8\"",
"Accept: text/xml",
"Cache-Control: no-cache",
"Pragma: no-cache",
"SOAPAction: \"run\"",
"Content-length: ".strlen($soap_request),
)(二)
$soap_do = curl_init();
curl_setopt($soap_do, CURLOPT_URL, "http://webservicepilot.tecdoc.net/pegasus-2- 0/services/TecdocToCatWL?wsdl" );
curl_setopt($soap_do, CURLOPT_CONNECTTIMEOUT, 10);
curl_setopt($soap_do, CURLOPT_TIMEOUT, 10);
curl_setopt($soap_do, CURLOPT_RETURNTRANSFER, true );
curl_setopt($soap_do, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($soap_do, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($soap_do, CURLOPT_POST, true );
curl_setopt($soap_do, CURLOPT_POSTFIELDS, $soap_request);
curl_setopt($soap_do, CURLOPT_HTTPHEADER, $header);
curl_setopt($soap_do, CURLOPT_PROXY, IF_ANY);
$result = curl_exec($soap_do);
谢谢,
高朗