I have an xml enabled label printer that will respond to a specific xml stream. I’ve created the appropriate view/routing in Rails to produce the XML, but the XML is always sent back to my browser, even if I change @_request.env[‘REMOTE_ADDR’]. What I need is the XML sent to the printer.
Is there a trivial way to do this, or am I approaching it the wrong way?
The answer to what I was trying to achieve (vs. what I asked) lies in the socket library within Ruby. I needed to simply open a tcp socket to the printer (to the RAW port), then perform a puts of the xml string that I needed to send:
And the rest works as expected.