If you are already getting the service details, then you should be able to understand and use the following UPnP specifications: PrintBasic
service and PrintEnhanced
service (if your printer supports it). I recommend using some service discovery tool in your network, like DeviceSpy from Intel UPnP Developer Suite. You will get an idea what informations your printer provides and whether it is reachable as state variable (perhaps evented), or you need to do a RPC on service function to obtain it. Giving specific howto on what is the difference between the two, and how to obtain them, is beyond the scope of simple S.O. answer. You can start with reading and understanding the UPnP Device Architecture document. Sniffing around in DeviceSpy and trying to invoke things and see the results is also very helpful.
A quick skim of the specs (i am more into the Media services) shows that you should be good with PrintBasic
for the status (look up PrinterState
/PrinterStateReasons
) and the paper sizes (look up MediaSize
/MediaType
). I could not find duplex, it might be hiding under some other name (perhaps Sides
?). It might be perfectly possible that these i found are one-value variables for the current job. The applicable values enumerations are then probably reachable under a different name, or you need to do a RPC to obtain it. I won't be replacing your R&D here :-)
Side note: doing it all yourself by opening HTTP connection and parsing the DOM is unnecessarily tedious (unless you are doing it for pure fun). Integrate one of the mature ready-made libs like Cling. To use UPnP properly, you need a lot of complicated stuff beyond reading a simple DOM. Like listening for event subscriptions and doing SOAP RPC.