Čia matote skirtumus tarp pasirinktos versijos ir esamo dokumento.
Next revision | Previous revision Next revision Both sides next revision | ||
lt:xmlcore [2020/06/17 13:42] robertas sukurtas |
lt:xmlcore [2020/07/13 13:20] robertas |
||
---|---|---|---|
Linija 35: | Linija 35: | ||
https://directo.gate.ee/xmlcore/demo_ee/xmlcore.asp?get=1&what=item&code=0000&key=20DAF3F822B782AF12D1198C23F45604 | https://directo.gate.ee/xmlcore/demo_ee/xmlcore.asp?get=1&what=item&code=0000&key=20DAF3F822B782AF12D1198C23F45604 | ||
+ | **PHP pavyzdys** | ||
+ | <code> | ||
+ | $url = 'https://directo.gate.ee/xmlcore/demo_ee/xmlcore.asp?get=1&what=item&key=20DAF3F822B782AF12D1198C23F45604'; | ||
+ | |||
+ | $ch = curl_init(); | ||
+ | curl_setopt($ch, CURLOPT_HEADER, 0); | ||
+ | curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | ||
+ | curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); | ||
+ | curl_setopt($ch, CURLOPT_URL, $url ); | ||
+ | curl_setopt($ch, CURLOPT_POST, 0); | ||
+ | |||
+ | $result = curl_exec($ch); | ||
+ | |||
+ | header('Content-Type: text/html; charset=utf-8'); | ||
+ | |||
+ | print '<textarea cols=80 rows=10>' . $result . '</textarea>'; | ||
+ | |||
+ | $data = new SimpleXMLElement($result); | ||
+ | |||
+ | print '<pre>'; | ||
+ | |||
+ | foreach ($data->items->item as $item) { | ||
+ | print $item['Code'] . chr(9) . '<b>' . $item['Name'] . '</b>' . chr(9) . $item['Class'] . '<br>'; | ||
+ | foreach ($item->datafields->data as $df ) { | ||
+ | print chr(9) . $df['code'] . ':' . $df['content'] . '<br>'; | ||
+ | } | ||
+ | } | ||
+ | </code> | ||
==== 2.2. Informacijos siuntimas į Directo (IN) ==== | ==== 2.2. Informacijos siuntimas į Directo (IN) ==== |