Share via


CreatePrintJobRequest element

The required CreatePrintJobRequest element sends a job request to the printer.

CreatePrintJobRequest is defined in the namespace at this URI: https://schemas.microsoft.com/windows/2005/05/wdp/print and referenced by the prefix wprt. (This resource may not be available in some languages and countries.)

Usage

<wprt:CreatePrintJobRequest>
  child elements
</wprt:CreatePrintJobRequest>

Attributes

There are no attributes.

Text value

None

Child elements

Element Description

PrintTicket

Defines the description and processing parameters of the currently identified job.

Parent elements

There are no parent elements.

Remarks

The WSD Print Service must support the CreatePrintJobRequest operation.

A client sends a CreatePrintJobRequest operation to the printer as the first step in submitting a job. CreatePrintJobRequest contains the PrintTicket element that describes the job's creation data, processing information (optional), and any document processing information to be applied at the document level for the job (optional).

The PrinterCapabilities element returned in a GetPrinterElementsResponse operation contains the values that the printer supports for a job creation operation.

If the client has made a valid request, the Print Service responds with the CreatePrintJobResponse element. The client can then send print data to the Print Service using one or more SendDocumentRequest or AddDocumentRequest operations.

If any error conditions are encountered, the Print Service must return the appropriate error code. All the codes described in Common Operation Error Codes can be returned from CreatePrintJobRequest. See Operation Error Reporting for details on how to report errors. The following additional error code could also be returned from this operation:

  • ServerErrorNotAcceptingJobs

    The Print Service should return ServerErrorNotAcceptingJobs when the server can't accept a new print job. This could occur because the printer has been put into service mode, or there is a user intervention condition and all the memory buffers have been exhausted. The client can try the unmodified request again at some later point in time with an expectation that the server has become unblocked and the printer is accepting jobs again.

    Fault Property Property Definition
    [Code] soap:Receiver
    [Subcode] wprt:ServerErrorNotAcceptingJobs
    [Reason] The service is temporarily blocked and can't accept new job or document requests
    [Detail] None

     

In the following example code, note that you must also prefix the names of the child and other elements with the appropriate namespace to be certain that your name references apply to elements in the correct namespace.

Examples

The following code example shows how to submit a job request to the print service.

<soap:Envelope
    xmlns:soap="https://www.w3.org/2003/05/soap-envelope"
    xmlns:wsdp="https://schemas.xmlsoap.org/ws/2005/05/devprof"
    xmlns:wsa="https://schemas.xmlsoap.org/ws/2004/08/addressing"
    xmlns:wprt="https://schemas.microsoft.com/windows/2005/05/wdp/print">
    soap:encodingStyle='https://www.w3.org/2002/12/soap-encoding' >
  <soap:Header>
    <wsa:To>uuid:DeviceUUID</wsa:To>
    <wsdp:ServiceId>uri:IdofThisService</wsdp:ServiceId>
    <wsa:Action>
      https://schemas.microsoft.com/windows/2005/05/wdp/print/CreatePrintJob
    </wsa:Action>
    <wsa:MessageID>uuid:UniqueMsgId</wsa:MessageID>
  </soap:Header>
  <soap:Body>
    <wprt:CreatePrintJobRequest>
      <wprt:PrintTicket>
        <wprt:JobDescription>
          <wprt:JobName>Example Job</wprt:JobName>
          <wprt:JobOriginatingUserName>Smith</wprt:JobOriginatingUserName>
        </wprt:JobDescription>
        <wprt:JobProcessing>
          <wprt:Copies MustHonor="1">3</wprt:Copies>
          <wprt:JobFinishings>
            <wprt:JogOffset>true</wprt:JogOffset >
          </wprt:JobFinishings>
          <wprt:Priority>50</wprt:Priority>
        </wprt:JobProcessing>
        <wprt:DocumentProcessing>
          <wprt:MediaSizeName>iso_a4_210x297mm</wprt:MediaSizeName>
          <wprt:MediaType>cardstock</wprt:MediaType>
          <wprt:NumberUp>
            <wprt:PagesPerSheet>1</wprt:PagesPerSheet>
            <wprt:Direction>RightDown</wprt:Direction>
          </wprt:NumberUp>
          <wprt:Orientation>Landscape</wprt:Orientation>
          <wprt:PrintQuality>Draft</wprt:PrintQuality>
          <wprt:Sides>OneSided</wprt:Sides>
        </wprt:DocumentProcessing>
      </wprt:PrintTicket>
    </wprt:CreatePrintJobRequest>
  </soap:Body>
</soap:Envelope>

See also

AddDocumentRequest

CreatePrintJobRequest

DocumentProcessing

GetPrinterElementsRequest

JobDescription

JobProcessing

PrintTicket

SendDocumentRequest

 

 

Send comments about this topic to Microsoft

Build date: 7/19/2012