Presentation is loading. Please wait.

Presentation is loading. Please wait.

Web Services for Devices Install: Printers & Scanners Mike Fenelon Software Developer Digital Documents, Platform and Solutions Team microsoft.com.

Similar presentations


Presentation on theme: "Web Services for Devices Install: Printers & Scanners Mike Fenelon Software Developer Digital Documents, Platform and Solutions Team microsoft.com."— Presentation transcript:

1 Web Services for Devices Install: Printers & Scanners Mike Fenelon Software Developer Digital Documents, Platform and Solutions Team microsoft.com Microsoft Corporation

2 Printing with Web Services for Devices

3 Printer Installation Step-By-Step Print Device PDO Print Service FDO Function Discovery (FD) Spooler WSD Port Monitor PnP-Printer Class Installer IPBusEnumerator WS-Discovery Provider User-Mode Enabled Bus Enumerator (UMBus)

4 Step 1- WSD Port Monitor Initialization Spooler WSD Port Monitor 1 Function Discovery (FD) Spooler starts up WSD Port Monitor (WSDMon) queries FD for all existing WSD print devices and creates the appropriate ports Any new devices found while the spooler wasn’t running will also kick off PnP installation for the Print Object (Step 9) WSDMon will also register for notifications on the correct FD category to receive future device notifications

5 Steps 2 & 3 – Printer Announcement and Discovery 2 3 Function Discovery (FD) WS-Discovery Provider Printer announces presence on the network by a WS-Discovery “Hello” message or responds to a Probe message from user opening Computers & Devices WS-Discovery provider recognizes the device and publishes it to Function Discovery (FD) Device Instance in FD contains all the basic device Metadata Device enabled for install if it contains PnP-X related metadata

6 Steps 4 & 5 – Notification from FD and Devnode Creation 5 4 User-Mode Enabled Bus Enumerator (UMBus) IPBusEnumerator Function Discovery (FD) From Within Computers & Devices the User adds/installs discovered device to Association Database IPBusEnum gets a notification of the newly associated Network Device IPBusEnum reads data from the new instance and uses the COM interface to the User- Mode Enabled Bus Enumerator (UMBus) to tell UMBus to create a new WS Print Service DevNode

7 Step 6 – Create Printer Service Devnode 6 Scan Service FDO User-Mode Enabled Bus Enumerator (UMBus) UMBus creates a File Device Object (FDO) for the WS-based Printer Service This FDO has a HardwareID & CompatibleId based on data from the Device Relationship Metadata

8 Spooler WSD Port Monitor Steps 7 & 8 – Print Service PnP Notification to FD and WSDMon 7 8 Function Discovery (FD) Print Service FDO FD gets PnP notification of the new WS-Printer Service device object FD adds device to the correct category/subcategory and creates notification which is picked up by WSDMon

9 Step 9 – GetMetadata 9 Spooler WSD Port Monitor User-Mode Enabled Bus Enumerator (UMBus) WSDMon activates the WS PrintProxy via the FD function instance and gets needed information from the device Uses GetMetadata calls or Print Service methods Gets device 1284 ID and determines port name WSDMon calls UMBus with info needed to create a Print Device Physical Device Object (PDO) in RAW mode This gets PnP started installing the Print Object in the spooler (Printers and Faxes folder)

10 Steps 10 & 11 – PDO Creation and Driver Install Print Device PDO PnP-Printer Class Installer User-Mode Enabled Bus Enumerator (UMBus) UMBus creates a Print Device PDO This PDO contains the Hardware ID, PortName, PrinterName, Location and comment field of the associated printer PnP searches installed INFs to find an INF that matches If no INF is found the Found New Hardware Wizard (FNHM) starts If an INF is found (or selected in the FNHW) PnP invokes the associated class installer, in this case the Printer Class Installer Install continues just like local PnP using the supplied information from the Print Device PDO to complete the installation

11 Printing Operation Step By Step Spooler WSD Port Monitor DriverAppQueue View B C D E G F A

12 Step A & B – Driver Initialization WSD Port Monitor B A Driver Bi-di enabled Driver queries device for configuration Driver uses Bi-di schema to request device configuration WSD Port Monitor uses GetPrinterElements operation to retrieve data from printer WSDMon converts XML data to Bi-di Schema responses

13 Step C – Application prints a document App C WSD Port Monitor Application uses DevCaps to get accurate device capabilities Application formats the document based on current device capabilities Application begins rendering the document

14 Step D & E – WSD Port Monitor prints a document D E WSD Port Monitor WSDMon sends CreatePrintJob operation to prepare device for print data CreatePrintJob response contains device JobID On first WritePort call WSDMon creates SendDocument opreation Device JobID and Job data transferred as part of SendDocument operation using MTOM

15 Step F & G – JobEndState Event and Rich Status Queue View F G WSD Port Monitor Printer send JobEndState event when the print job finishes WSD Port Monitor creates Rich Status notification based on information in the event Job Status in Queue View is updated after SetJob call

16 Scanning with Web Services for Devices

17 Scan Service FDO User-Mode Enabled Bus Enumerator (UMBus) Function Discovery (FD) WS-Discovery Provider WIA Service WSD Scan Driver IPBusEnumerator Scanner Installation Step By Step

18 Step 1 – WIA Service and Scan Class Driver Initialization WIA Service starts up or User starts a WIA application WIA Service queries PnP for all existing Scan devices and creates the appropriate objects (Step 8) Function Discovery (FD) WIA Service WSD Scan Driver 1

19 Scanner announces presence on the network by a WS-Discovery “Hello” message or responds to a Probe message from user opening Computers & Devices WS-Discovery provider recognizes the device and publishes it to Function Discovery (FD) Device Instance in FD contains all the basic device Metadata Device enabled for install if it contains PnP-X related metadata 2 3 Function Discovery (FD) WS-Discovery Provider Steps 2 & 3 – Scanner Announcement and Discovery

20 From Within Computers & Devices the User adds/installs discovered device to Association Database IPBusEnum gets a notification of the newly associated Network Device IPBusEnum reads data from the new instance and uses the COM interface to the User-Mode Enabled Bus Enumerator (UMBus) to tell UMBus to create a new WS Print Service DevNode User-Mode Enabled Bus Enumerator (UMBus) 5 4 IPBusEnumerator Function Discovery (FD) Steps 4 & 5 – Notification from FD and Devnode Creation

21 Steps 6 – Create Scanner Service Devnode UMBus creates a File Device Object (FDO) for the WS-based Scanner Service This FDO has a HardwareID & CompatibleId based on data from the Device Relationship Metadata 6 Scan Service FDO User-Mode Enabled Bus Enumerator (UMBus)

22 WIA Service WSD Scan Driver WIA Service gets PnP notification of the new WS- Scanner Service device object WIA creates a unique identifier for the device WSD Scan Driver instance is loaded for the new scanner Scan Service Function Instance is activated and the ScanProxy DLL is loaded Scanner installation is complete! 7 Step 7 – PnP Notification and WSD Scan Driver Object Initialization Scan Service FDO

23 Scanning Operation in the Home - Step By Step WIA Service C D B A WSD Scan Driver

24 Step A – PC Registers with Scanner At scan object creation the PC creates scan destination(s) in the scan device Assigns device a unique identifier Subscribes for ScanAvailableEvent with wscn:ScanDestinations extension operation to set display name for current PC Receives scan context from device A WIA Service WSD Scan Driver

25 Steps B & C – User Initiates Scan User selects destination from device display panel User presses scan button Device sends a ScanAvailableEvent to selected PC Event contains scanner identifier and scan context C B WIA Service WSD Scan Driver Note: this could also be initiated from an application on the PC if scanner doesn’t have LCD or multi-PC capability

26 Step D – Client Scans From Device Client uses CreateScanJob & RetreiveImage operations to initiate scan and retrieve scan data Scan ticket in CreateScanJob operation contains desired scanning parameters Scan data is retrieved as part of the RetrieveImage operation response in any form using MTOM D WIA Service WSD Scan Driver

27 XML Messages for Printing

28 GetPrinterElements Request Example http://schemas.microsoft.com/windows/2005/05/wdp/print/GetPrinterElements --- Header removed for Brevity --- wprt:PrinterConfiguration wprt:PrinterConfiguration

29 GetPrinterElements Response Example erElementsResponse --- Header removed for Brevity --- ...

30 CreatePrintJob Request Example http://schemas.microsoft.com/windows/2005/05/wdp/print/CreatePrintJob --- Header removed for Brevity --- ...

31 CreatePrintJob Response Example intJobResponse --- Header removed for Brevity --- ...

32 SendDocument Request Example mime-version: 1.0 Content-Type: multipart/related; type=application/xop+xml;boundary=“--=_NextPart_123_321_ E9F5D”;start=””;startinfo=application/soap+xml----=_NextPart_123_321_ E9F5D Content-Type: application/xop+xml; type=application/soap_xop+xml charset=UTF-8 Content-Transfer-Encoding: binary Content-ID: Content-ID: uuid:DeviceUUID uuid:DeviceUUID uri:IdofThisService uri:IdofThisService http://schemas.microsoft.com/windows/2005/05/wdp/print/SendDocument uuid:UniqueMsgId uuid:UniqueMsgId

33 SendDocument Request Example (cont.) IdFromCreateJobRequest IdFromCreateJobRequest DocIdNumber DocIdNumber Noneapplication/octet-streamExample.xmltrue ----=_NextPart_123_321_ E9F5D Content-Type: application/postscript; Content-Transfer-Encoding: binary Content-ID: Content-ID: Document PDL Data ----=_NextPart_123_321_ E9F5D--

34 SendDocument Response Example http://schemas.microsoft.com/windows/2005/05/wdp/print/SendDocumentResponse --- Header removed for Brevity ---

35 XML Messages for Scanning

36 Subscribe Request Example http://schemas.xmlsoap.org/ws/2004/08/eventing/Subscribeuri:scn --- Headers removed for Brevity --- http:// :5357/872b563f eb-8e80-a721fe7a7fd9PT10M Scan to MFenelon2L Scan to MFenelon2L Scan Scan for Print to MFenelon2L Scan for Print to MFenelon2L ScanToPrint

37 Subscribe (ScanAvailableEvent) Response Example http://schemas.xmlsoap.org/ws/2004/08/eventing/SubscribeResponse --- Headers removed for Brevity --- http:// :80/TestDeviceuri:scnuuid:0c27676b-e d dPT9M SScan a bd6c-9c95d302c a bd6c-9c95d302c454 ScanToPrint6fcbbc0f-c035-41ca-a912-f6961a2e2257

38 ScanAvailableEvent Example http:// :5357/872b563f eb-8e80-a721fe7a7fd9http://schemas.microsoft.com/windows/2005/08/wdp/scan/ScanAvailableEventScana74dc73c-34b6-4e99-a724-c006f4625b68

39 CreateScanJob Request Example http:// :80/TestDevicehttp://schemas.microsoft.com/windows/2005/08/wdp/scan/CreateScanJoburi:scn --- Headers removed for Brevity --- a74dc73c-34b6-4e99-a724-c006f4625b68113527a bd6c-9c95d302c454 GetImage from ScanAvailableEvent GetImage from ScanAvailableEvent MFenelon Scanning from platen.. Scanning from platen..

40 CreateScanJob Request Example (Cont.) exif1Platen100010000RGB24200

41 CreateScanJob Response Example http://schemas.microsoft.com/windows/2005/08/wdp/scan/CreateScanJobResponse --- Headers removed for Brevity --- 1 b5838c21-63a1-4e99-a724-b459218cae7f b5838c21-63a1-4e99-a724-b459218cae7f ....

42 RetrieveImage Request Example http://schemas.microsoft.com/windows/2005/08/wdp/scan/RetrieveImageuri:scn --- Headers removed for Brevity --- 1 b5838c21-63a1-4e99-a724-b459218cae7f b5838c21-63a1-4e99-a724-b459218cae7f ScannedImage001.JPG

43 RetrieveImage Response Example Content-Type: multipart/related; start-info=application/soap+xml; charset="utf-8” mime-version: aa7d814-adc1-47a2-8e1c-07585b9892a4 content-type: application/xop+xml; type="application/soap+xml"; charset="utf- 8" content-transfer-encoding: binary content-id: content-id: http://schemas.microsoft.com/windows/2005/08/wdp/scan/RetrieveImageResponse

44 RetrieveImage Response Example (Cont.)


Download ppt "Web Services for Devices Install: Printers & Scanners Mike Fenelon Software Developer Digital Documents, Platform and Solutions Team microsoft.com."

Similar presentations


Ads by Google