1
私はいくつかのpostとphpのマニュアルページを結合しようとしましたが、PHPソープクライアントを使って単純なsoap要求をする方法をよく理解していませんでした。シンプルなphp soap client help
これは私が参照するためにきたことを石鹸例です:
http://<endpoint>/ourServer/services/spPushDataServicePort.svc
Encoding: UTF-8
Http-Method: POST
Content-Type: text/xml; charset=UTF-8
Headers: {connection=[Keep-Alive], Content-Length=[789], content-type=[text/xml; charset=UTF-8], host=[urbelog.tilab.com], SOAPAction=["pushData"], user-agent=[Axis2], via=[1.1 urlXXX], x-forwarded-for=[Url2Ip], x-forwarded-host=[urlXXX], x-forwarded-server=[urlXXX]}
Payload: <?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header/>
<soapenv:Body>
<ns1:outData xmlns:ns1="http://serverYYY">
<vin>M55</vin>
<serviceProvider>URBELOG</serviceProvider>
<codeFunction>FLEET</codeFunction>
<date>2016-10-19T11:06:20.000+00:00</date>
<groups>
<name>GPS_DATA</name>
<params>
<name>LATITUDE</name>
<value>45.086666</value>
</params>
<params>
<name>LONGITUDE</name>
<value>9.29</value>
</params>
<params>
<name>TIMESTAMP</name>
<value>2016-10-19 13:06:20</value>
</params>
<params>
<name>ODOMETER</name>
<value>483734.56</value>
</params>
</groups>
</ns1:outData>
</soapenv:Body>
</soapenv:Envelope>
は、これは私が今まで書いたものです: クラスのsendData {
function __construct($vin, $serviceProvider,$codeFunction, $date, $lat, $long, $timeStamp, $mt)
{
$this->vin = $vin;
$this->serviceProvider = $serviceProvider;
$this->codeFunction=$codeFunction;
$this->date = $date;
$this-> groups= array('name'=>"GPS_DATA",
array('params'=>['LATITUDE'=>$lat]),
array('params'=>['LONGITUDE'=>$long]),
array('params'=>['TIMESTAMP'=>$timeStamp]),
array('params'=>['ODOMETER'=>$mt]));
}
}
/* Initialize webservice with your WSDL */
$client = new SoapClient("http://<endpoint>/ourServer/services/spPushDataServicePort.svc");
/* Set your parameters for the request */
$params=new sendData("uno","due","3","4","5","6","7","8");
/* Invoke webservice method with your parameters, in this case: Function1 */
$response = $client->__soapCall(?????, $params);
var_dump($response);
私の質問は以下のとおりです。
$response = $client->__soapCall(?????, $params);
にはどのようなiveを設定しますか?部?- paramsをsoap関数に渡す正しい方法は何ですか?
- 問題への適切かつスマートなアプローチですか?
ありがとう私はあなたのヒント、歓声で試してみます – JahStation