we are RFID printing label through an xml file. The printer will be connected to the n/w. I will send xml file to the printer through Hyperterminal via tcp\ip port and label will be printer.
Here i need to automate the file formation and sending part. Need to create xml file and send it to tcp\ip port where the printer is listening. Problem over here is, xml is created and sent to tcp\ip port but label is not printer. but if the same file save to some local drive and if sent to hyper terminal label is being printed. I just want to ensure whether the xml is sent to the port and the complete file is send. Please someone help me in resolving this issue. TIA.
For starters, you should never use Readers or Writers with ports - use Streams instead. I also advise to be explicit about the encoding - the printer may expect data in a particular encoding (instead of whatever the platform default encoding on the machine running this code is - which is what you are currently using).
I don't think it uses any encoding technic because i can able to send the same xml which is saved to local drive to tcp\ip via hyper terminal and print. Is there any way to check whether it is posted in tcp\ip sucessfully and complete file reaches to the port?
Joined: Mar 22, 2005
Transforming character data to binary data -which is what this code does- always involved an encoding, and the difference between this code and whatever that other app does may well be the use of specific encodings.
Neeba Rebbaca wrote:I don't think it uses any encoding technic because i can able to send the same xml which is saved to local drive to tcp\ip via hyper terminal and print. Is there any way to check whether it is posted in tcp\ip sucessfully and complete file reaches to the port?
By "port", I am going to assume you mean that the file is transferred to the other machine. The easiest way is to work it into the protocol. Have you application either communicate the size of the transfer, or have some sort of end-of-file indicator. Or course, for the second case, you will need to confirm that the indicator is not part of the file.