Epson TM-U220 ePOS-Print XML Users Manual - Page 51
To Call SOAP/HTTP Interface WSDL supported
View all Epson TM-U220 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 51 highlights
Chapter 3 Programming Guide To Call SOAP/HTTP Interface (WSDL supported) Refer to the following program. TITLE function sendDocument() { //Create a print document var request = ''; request += ''; request += ''; request += 'Hello, World! '; request += ''; request += ''; //Create a print parameter var param = ''; param += 'local_printer'; param += '10000'; param += 'ABC123'; param += ''; //Create a SOAP envelop var soap = '' + '' + param + '' + request + ''; //Create an XMLHttpRequest object var xhr = new XMLHttpRequest(); //Set the end point address var url = 'http://192.168.192.168/cgi-bin/epos/service.cgi'; //Open an XMLHttpRequest object xhr.open('POST', url, true); // xhr.setRequestHeader('Content-Type', 'text/xml; charset=utf-8'); xhr.setRequestHeader('If-Modified-Since', 'Thu, 01 Jan 1970 00:00:00 GMT'); xhr.setRequestHeader('SOAPAction', '""'); // Send print document xhr.send(soap); } 51