Kasutaja tarvikud

Lehe tööriistad



et:xmlcore

Erinevused

Siin näed erinevusi valitud versiooni ja hetkel kehtiva lehekülje vahel.

Lõlita võrdlemise vaatele

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
et:xmlcore [2020/10/02 08:33] – [Praktiline näide - artiklite väljund] ottet:xmlcore [2021/08/30 15:15] – [Sisend] ott
Rida 57: Rida 57:
 <wrap important>Käesolevas näites toodud URLid ja XML sõnumid on täiesti fiktiivsed ja pole teenuse testimiseks kasutatavad. Testimine toimub alati reaalse installatsiooni suhtes.</wrap> <wrap important>Käesolevas näites toodud URLid ja XML sõnumid on täiesti fiktiivsed ja pole teenuse testimiseks kasutatavad. Testimine toimub alati reaalse installatsiooni suhtes.</wrap>
  
-Oletame, et liidese URL on antud juhul https://directo.gate.ee/xmlcore/this_is_the_worlds_greatest_company/xmlcore.asp+Oletame, et liidese URL on antud juhul https://login.directo.ee/xmlcore/this_is_the_worlds_greatest_company/xmlcore.asp
  
 Andmeid kirjeldab schema {{:et:xml_in_arved.xsd|}} Andmeid kirjeldab schema {{:et:xml_in_arved.xsd|}}
Rida 142: Rida 142:
 <code php> <code php>
  
-$xmldata = '<'.'?xml version="1.0" encoding="UTF-8"?> 
-<invoice AppKey="1234567879012345678790" InvoiceNr="123"  
- InvoiceDate="2015-06-07" CustomerCode="CUST001"> 
-    <lines> 
-      <line ProductID="KILLERPRODUCT" Quantity="3" UnitPriceWoVAT="123.45"/> 
-      <line ProductID="FREESAMPLE" Quantity="1" UnitPriceWoVAT="0.00"/> 
-    </lines> 
-</invoice>'; 
  
-$url = 'https://directo.gate.ee/xmlcore/this_is_the_worlds_greatest_company/xmlcore.asp';+$url = 'https://login.directo.ee/xmlcore/demo_ee/xmlcore.asp'
 +$key = '2852DD553B767B463C807ADB36B5BB2F'; 
 + 
 +$xmldata = <<<XML 
 +<?xml version="1.0" encoding="utf-8"?> 
 +<items> 
 +  <item code="LMP0001" name="Lambikas" class="LAMP" barcode="123456789" salesprice="11.25" description="See on suur lamp" > 
 +    <datafields> 
 +      <data code="ART_VARV" content="Punane" /> 
 +      <data code="VEEBIS" content="Jah" /> 
 +    </datafields> 
 +  </item> 
 +</items> 
 +XML;
  
 $ch = curl_init(); $ch = curl_init();
 +
 curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_HEADER, 0);
 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
Rida 159: Rida 165:
 curl_setopt($ch, CURLOPT_URL, $url ); curl_setopt($ch, CURLOPT_URL, $url );
 curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POST, 1);
 +#curl_setopt($ch, CURLOPT_VERBOSE, 1);
 +#curl_setopt($ch, CURLOPT_HEADER, 1);
 +#curl_setopt($ch, CURLINFO_HEADER_OUT, true);
 +curl_setopt($ch, CURLOPT_POSTFIELDS, 'key='.urlencode($key).'&xmldata='.urlencode($xmldata).'&put=1&what=item' );
  
-curl_setopt($ch, CURLOPT_POSTFIELDS, 'xmldata='.urlencode($xmldata).'&put=1&what=invoice' );  
 $result = curl_exec($ch); $result = curl_exec($ch);
 +curl_close($ch);
  
-print '<textarea cols=80 rows=10>' . $result . '</textarea>';+echo '<pre>'; 
 + 
 +print '</pre><textarea cols=80 rows=10>' . $result . '</textarea>';
  
-curl_close($ch); 
 </code> </code>
et/xmlcore.txt · Viimati muutnud: 2024/04/16 09:19 persoon toomas

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki