印刷用デバイス上の Web サービス (WS-Print)

重要

プリンターデバイス開発におけるWindows 10および11での印刷体験をカスタマイズするために、MicrosoftのIPPインボックスクラスドライバーとPrint Support Apps (PSA)の使用を推奨します。

詳細については、プリントサポートアプリデザインガイド.

印刷用デバイス上の Web サービス (WS-Print) は、印刷および周辺機器のスキャンのための接続プロトコルを提供するために Windows Vista で導入されました。

概要

Web サービス テクノロジは、情報を記述および共有するための一般的なフレームワークを提供します。 その結果、Windowsには、ネットワークに接続されたデバイスでサービスを消費および制御するための一連のプロトコルが付属しています。

デバイスの製造元が Windows でのデバイスの接続、インストール、使用についての向上したカスタマー エクスペリエンスを利用できるよう、印刷とスキャンに関する 4 つの Web サービス仕様が存在します。

WS-Print v1.1

Windows 8 では、デバイス上の Web サービス (WSD) の印刷スキーマが v1.1 に更新されました。 このバージョンのスキーマ (WS-Print v1.1 と呼ばれる) は、強化されたドライバー構成、インク/トナーの色表現の改善、およびデバイス モデル ID をサポートするように更新されました。

WS-Print v1.2

Windows 8.1 の場合、WS-Print には WS-Print v1.1 で使用されるすべての操作とスキーマ要素が含まれていますが、デバイス上の Web サービスの印刷サービス定義が更新されています。 また、結果として得られる印刷用デバイス上の新しい Web サービスは WS-Print v1.2 です。

WS-Print v1.2 では、新しいスキーマ要素と新しい操作のサポートが追加されました。 新しいスキーマ要素 "SupportsWSPrintV12" は、WS-Print V1.2 のサポートを識別するために使用されます。 新しい操作 "SetPrinterElements" を使用すると、クライアントはプリンターでスキーマ要素の値を設定できます。 たとえば、クライアントは、プリンターでインクジェット ヘッドの再配置に使用される "InkHeadAlignmentValue" というカスタム要素を設定できます。

便宜上、仕様は、関連する Web サービス記述言語 (WSDL) および XML スキーマ定義 (XSD) とともに、完全なスタンドアロン形式で、この「ダウンロード」セクションに用意されています。 デバイス仕様上のこれら 4 つの Web サービスは、Windows ドライバー開発キット (WDK) を参照する付属の技術文書ライセンス契約の対象となります。

以下のセクションでは、WS-Print のさまざまな側面について、より詳細な情報を提供します。

シーケンス図

以下のシーケンス図は、サポートされている WS-Print 名前空間のバージョンを判別し、拡張スキーマ・エレメントを取得するための、クライアントとプリンターの間の対話を示しています。

WS-Print v1.1 シーケンス図

以下は、WS-Print v1.1 をサポートするプリンターの対話シーケンス図です。

sequence diagram showing client-printer interaction regarding ws-print v1.1 support, and the subsequent queries for printer description and configuration.

プリンターが WS-Print v1.1 をサポートしている場合、クライアントからの GetPrinterElements(wprt:PrinterDescription) 照会に応答して、プリンターはサポートしていることを示す情報を送り返します。

プリンターが WS-Print v1.1 をサポートしていることを確認した後、クライアントは GetPrinterElements(wprt11:DriverConfiguration) クエリを送信し、プリンターは要求されたドライバー構成情報で応答します。

WS-Print v1.2 シーケンス図

以下は、WS-Print v1.2 をサポートするプリンターの対話シーケンス図です。

sequence diagram showing client-printer interaction regarding ws-print v1.2 support, and the subsequent queries for printer description and configuration.

プリンターが WS-Print v1.2 をサポートしている場合、クライアントからの GetPrinterElements(wprt:PrinterDescription) 照会に応答して、プリンターはサポートしていることを示す情報を送り返します。

さらに、プリンターは、GetPrinterElements(wprt:PrinterDescription) 呼び出しに応答して wprt12:SupportsWSPrintV12 を返す必要があります。 その後、クライアントは SetPrinterElements 操作を呼び出して、WS-Print デバイスでサポートされているスキーマ内の 1 つ以上のデータ要素を設定できます。

プリンターが WS-Print v1.2 をサポートしていることを確認した後、クライアントは GetPrinterElements(wprt12:DriverConfiguration) クエリを送信し、プリンターは要求されたドライバー構成情報で応答します。

名前空間

WS-Print v1.1 名前空間

Namespace:<https://schemas.microsoft.com/windows/2010/06/wdp/printv11>XML 名前空間の定義:xmlns:wprt12="<https://schemas.microsoft.com/windows/2012/10/wdp/printV12>"

WS-Print v1.2 名前空間

Namespace:<https://schemas.microsoft.com/windows/2012/10/wdp/printV12>XML 名前空間の定義:xmlns:wprt11="<https://schemas.microsoft.com/windows/2010/06/wdp/printv11>"

WS-Print 1.1 サポートの指定

WS-Print 1.1 エレメントをサポートするプリンターは、wprt11:SupportsWSPrintv11 を含むように PrinterDescription を更新する必要があります。 wprt11:SupportsWSPrintv11 が指定されておらず、true に設定されている場合、WSDMon はプリンターに WS-Print 1.1 要素を要求しません。

WS-Print v1.1 をサポートする印刷デバイスでは、Windows がその名前空間内の他の要素を照会するために、PrinterDescription に次のコンテンツを含める必要があります。

<soap:Envelope
...
  xmlns:wprt11="https://schemas.microsoft.com/windows/2010/06/wdp/printv11">"
...
  <wprt11:SupportsWSPrintv11>true</wprt11:SupportsWSPrintv11>
...

次の XML スニペットは、WSD 印刷サービス仕様 v1.0 から派生したもので、前のセクションのコンテンツの適切な使用法を示しています。

<soap:Envelope
        xmlns:soap="https://www.w3.org/2003/05/soap-envelope"
        xmlns:wsa="https://schemas.xmlsoap.org/ws/2004/08/addressing"
        xmlns:wprt="https://schemas.microsoft.com/windows/2006/08/wdp/print"
        xmlns:wprt11="https://schemas.microsoft.com/windows/2010/06/wdp/printv11">"
  <soap:Header>
    <wsa:To>https://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To>
    <wsa:Action>
      https://schemas.microsoft.com/windows/2006/08/wdp/print/GetPrinterElementsResponse
    </wsa:Action>
    <wsa:MessageID>uuid:UniqueMsgId</wsa:MessageID>
    <wsa:RelatesTo>uuid:MsgIdOfTheGetPrinterElementsRequest</wsa:RelatesTo>
  </soap:Header>
  <soap:Body>
    <wprt:GetPrinterElementsResponse>
      <wprt:PrinterElements>
        <wprt:ElementData Name="wprt:PrinterDescription" Valid="true">
          <wprt:PrinterDescription>
            <wprt:ColorSupported>true</wprt:ColorSupported>
            <wprt:DeviceId>MFG:Acme;MDL:PrintMaster 9020</wprt:DeviceId>
            <wprt:MultipleDocumentJobsSupported>true</wprt:MultipleDocumentJobsSupported>
            <wprt:PagesPerMinute>20</wprt:PagesPerMinute>
            <wprt:PagesPerMinuteColor>8</wprt:PagesPerMinuteColor>
            <wprt:PrinterName xml:lang="en-AU, en-CA, en-GB, en-US">
              Accounting Printer in Copy Room 2
            </wprt:PrinterName>
            <wprt:PrinterInfo xml:lang="en-AU, en-CA, en-GB, en-US">
              Printer for use of Accounting only
            </wprt:PrinterInfo>
            <wprt:PrinterLocation xml:lang="en-AU, en-CA, en-GB, en-US">
              LA Campus – Building 3
            </wprt:PrinterLocation>
            <wprt11:SupportsWSPrintv11>true</wprt11:SupportsWSPrintv11>
          </wprt:PrinterDescription>
        </wprt:ElementData>
      </wprt:PrinterElements>
    </wprt:GetPrinterElementsResponse>
  </soap:Body>
</soap:Envelope>

次の XML スニペットは、WS-Print v1.1 をサポートする印刷デバイスのスキーマを示しています。

<xs:schema targetNamespace="https://schemas.microsoft.com/windows/2010/06/wdp/printv11"
           xmlns:wprt11="https://schemas.microsoft.com/windows/2010/06/wdp/printv11"
           xmlns:xs="https://www.w3.org/2001/XMLSchema"
           elementFormDefault="qualified">

<xs:annotation>
    <xs:documentation>
        WS-Print Extensions for Driver Configuration and Consumable Definition
        Copyright 2010 Microsoft Corp. All rights reserved
    </xs:documentation>
</xs:annotation>

<xs:annotation>
    <xs:documentation> A Boolean element that denotes support for WS-Print V11 extensions
    </xs:documentation>
</xs:annotation>

<xs:element name="SupportsWSPrintv11" type="xs:boolean"/>

WS-Print 1.2 サポートの指定

WS-Print 1.2 要素をサポートするプリンターは、wprtV12:SupportsWSPrintV12 を含むように PrinterDescription を更新する必要があります。 wprtV12:SupportsWSPrintV12 が指定されておらず、true に設定されている場合、WSDMon はプリンターから WS-Print 1.2 要素を要求しません。

WS-Print v1.2 をサポートする印刷デバイスでは、Windows がその名前空間内の他の要素を照会するために、PrinterDescription に次のコンテンツを含める必要があります。

<soap:Envelope
…
    xmlns:wprtV12="https://schemas.microsoft.com/windows/2012/10/wdp/printV12">
…
    <wprtV12:SupportsWSPrintV12>true</wprtV12:SupportsWSPrintV12>
…
</soap:Envelope>

次の XML スニペットは、WSD 印刷サービス仕様 v1.2 から派生したもので、前のセクションのコンテンツの適切な使用法を示しています。

<soap:Envelope
     xmlns:soap="https://www.w3.org/2003/05/soap-envelope"
     xmlns:wsa="https://schemas.xmlsoap.org/ws/2004/08/addressing"
     xmlns:wprt="https://schemas.microsoft.com/windows/2006/08/wdp/print"
     xmlns:wprtV12="https://schemas.microsoft.com/windows/2012/10/wdp/printV12">
     <soap:Header>
          <wsa:To>https://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To>
          <wsa:Action>
               https://schemas.microsoft.com/windows/2006/08/wdp/print/GetPrinterElementsResponse
          </wsa:Action>
          <wsa:MessageID>uuid:UniqueMsgId</wsa:MessageID>
          <wsa:RelatesTo>uuid:MsgIdOfTheGetPrinterElementsRequest</wsa:RelatesTo>
     </soap:Header>
     <soap:Body>
         <wprt:GetPrinterElementsResponse>
            <wprt:PrinterElements>
             <wprt:ElementData Name="wprt:PrinterDescription" Valid="true">
                <wprt:PrinterDescription>
                     <wprt:ColorSupported>true</wprt:ColorSupported>
                         <wprt:DeviceId>MFG:Acme;MDL:PrintMaster 9020</wprt:DeviceId>
                         <wprt:MultipleDocumentJobsSupported>true</wprt:MultipleDocumentJobsSupported>
                     <wprt:PagesPerMinute>20</wprt:PagesPerMinute>
                     <wprt:PagesPerMinuteColor>8</wprt:PagesPerMinuteColor>
                     <wprt:PrinterName xml:lang="en-AU, en-CA, en-GB, en-US">
                             Accounting Printer in Copy Room 2</wprt:PrinterName>
                         <wprt:PrinterInfo xml:lang="en-AU, en-CA, en-GB, en-US">
                             Printer for use of Accounting only</wprt:PrinterInfo>
                         <wprt:PrinterLocation xml:lang="en-AU, en-CA, en-GB, en-US">
                             LA Campus – Building 3</wprt:PrinterLocation>
                         <wprtV12:SupportsWSPrintV12>true</wprtV12:SupportsWSPrintV12>
                    </wprt:PrinterDescription>
             </wprt:ElementData>
            </wprt:PrinterElements>
         </wprt:GetPrinterElementsResponse>
      </soap:Body>
</soap:Envelope>

以下の 3 つのセクションのスキーマの例は、WS-Print V1.1 で導入されたいくつかの新しい要素の使用方法を示しています。 WS-Print V1.1 名前空間で導入されたすべての要素の詳細については、以下の「ダウンロード」セクションに記載されている WS-Print v1.0 – v1.2 のサポート ファイルを参照してください。

拡張ドライバー構成

このスキーマは、このデバイスのデバイス固有の GPD または PPD 構成ファイルを提供します。

   <xs:annotation>
        <xs:documentation>Driver Configuration File definition</xs:documentation>
    </xs:annotation>
    <xs:element name="DriverConfiguration" type="wprt11:DriverConfigurationType"/>
    <xs:complexType name="DriverConfigurationType">
        <xs:sequence>
            <xs:element name="GPDConfigFile" type="xs:string" minOccurs="0" />
            <xs:element name="PPDConfigFile" type="xs:string" minOccurs="0" />
            <xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
        <xs:anyAttribute namespace="##other" processContents="lax" />
    </xs:complexType>

デバイス モデル ID

次のスキーマは、デバイスの ModelID を記述し、デバイス メタデータの取得に使用されます。 ModelID の詳細については、「ModelID 要素」を参照してください。

    <xs:annotation>
        <xs:documentation> Print Device Model Id value for device differentiation</xs:documentation>
        <xs:documentation> Always represented as a GUID</xs:documentation>
    </xs:annotation>
    <xs:element name="DeviceModelId" type="wprt11:DeviceModelIdGuidType"/>
    <xs:simpleType name="DeviceModelIdGuidType">
        <xs:restriction base="xs:string">
            <xs:length value="36"/>
        </xs:restriction>
    </xs:simpleType>

インク/トナーの色表現値

次のスキーマは、特定のインクまたはトナーの種類の色を表す RGB トリプルを取得します。 この値は、アプリの UI で色をより適切に表現できるように、インクまたはトナーの消耗品に指定する必要があります。

    <xs:annotation>
        <xs:documentation>
            Ink/Toner Color Representation definition
            A 6-digit hex representation of the RGB color value this Consumable entry represents.
            Examples of these values are:
                Black – 000000
                Red – FF0000
                White – FFFFFF
                Magenta – FF00FF
                Cyan – 00FFFF
                Yellow – FFFF00
                Blue – 0000FF
        </xs:documentation>    </xs:annotation>
    <xs:element name="ColorRepresentation" type="wprt11:ColorRepType"/>
    <xs:simpleType name="ColorRepType">
        <xs:restriction base="xs:string">
            <xs:length value="6"/>
        </xs:restriction>
    </xs:simpleType>

このトピックで前述したように、WS-Print v1.2 セクションでは、WS-Print V1.2 名前空間で次の新しい操作が導入されました。

SetPrinterElements

SetPrinterElements 操作は新しく、クライアントはプリンターのスキーマ要素の値を設定できます。 SetPrinterElements 操作には、8 つの要求要素と 4 つの応答要素があります。 要求要素と応答要素は、WS-Print デバイス スキーマに関連するデータの挿入と取得をクライアントに細かく制御できるようにします。

たとえば、ElementPath データ要素 (SetPrinterElements 操作の一部) は、設定するデータ要素の Printer スキーマ内の場所を表す XPath 文字列です。

SetPrinterElements 操作の詳細については、以下の「ダウンロード」セクションに記載されている WS-Print v1.0 – v1.2 のサポート ファイルを参照してください。

ダウンロード

WS-Print v1.0 – v1.2 の仕様およびサポート ファイル

File:Print Device Definition V1.0 for Web Services on DevicesDescription: 2.64 MB (メガバイト) zip file containing Microsoft Word document and supporting files;2013 年 9 月 16 日

仕様ファイルとサポート ファイル

File:Print Device Definition V1.0 for Web Services on DevicesDescription: 76 KB (キロバイト)、Microsoft Word 文書とサポート ファイルを含む自己解凍ファイル。2007 年 1 月 29 日

ファイル:デバイス上の Web サービス用スキャン サービス定義 V1.0説明: (Microsoft Word ドキュメントとサポート ファイルを含む 1.5 MB zip ファイル、2012 年 2 月 9 日) )

File:Print Device Definition V1.0 for Web Services on DevicesDescription: 76 KB (キロバイト)、Microsoft Word 文書とサポート ファイルを含む自己解凍ファイル。2007 年 1 月 29 日

V4 printer driver connectivity