SendDocumentRequest element

The required SendDocumentRequest element submits print data associated with a job to the printer.

SendDocumentRequest 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:SendDocumentRequest>
  child elements
</wprt:SendDocumentRequest>

Attributes

There are no attributes.

Text value

None

Child elements

Element Description

DocumentData

Provides the binary data representing the document to be printed.

DocumentDescription

Describes all attributes associated with the basic creation of the current document.

DocumentProcessing

Contains all of the requested processing attributes that are applicable at the document level.

JobId

Uniquely identifies a job on a printer.

LastDocument

Specifies whether more documents will be submitted for the current print job.

Parent elements

There are no parent elements.

Remarks

The WSD Print Service must support the SendDocumentRequest operation.

SendDocumentRequest is the client's next step in submitting a job to the printer after CreatePrintJobResponse has been returned. The client can send one or more SendDocumentRequest operations to the WSD Print Service, where each SendDocumentRequest sends all the print data for a single document.

Each SendDocumentRequest can optionally contain the DocumentProcessing element that contains the basic processing attributes to be applied to the currently identified document. If a DocumentProcessing element is contained within SendDocumentRequest, the Print Service should use the specified data values to override the PrintTicket values submitted in CreatePrintJobRequest. Note that this processing information overrides any parameters set during the CreatePrintJobRequest operation for this document only. If the client does not send DocumentProcessing, the Print Service should use the PrintTicket element submitted in CreatePrintJobRequest to obtain document processing information.

The PrinterCapabilities element returned in a GetPrinterElementsResponse operation indicates the values of the arguments that the printer supports for a job creation operation. The WSD Print Service should do the following validation, in order, on the DocumentDescription element to ensure that the client has selected valid description values from PrinterCapabilities:

  • If the Format element is not supported, the WSD Print Service must reject the request and return the ClientErrorDocumentFormatNotSupported error code.
  • If the Compression element is not supported, the printer must reject the request and return the ClientErrorCompressionNotSupported error code.

If a printer does not support multi-document jobs, only one SendDocumentRequest operation should follow each CreatePrintJobRequest operation, and the LastDocument element of SendDocumentRequest should always be set to true. The Print Service should return the ClientErrorMultipleDocumentsNotSupported error if the client sets LastDocument to false in this situation.

All the codes described in Common Operation Error Codes can be returned from SendDocumentRequest. See Operation Error Reporting for details on how to report errors. The following additional error codes can also be returned from this operation:

  • ClientErrorJobIdNotFound

    The printer cannot find a job matching the JobId value or the JobId value is not in the range: 1 to 2147483647 (231-1).

    Fault Property Property Definition
    [Code] soap:Sender
    [Subcode] wprt:ClientErrorJobIdNotFound
    [Reason] Specified JobId not found
    [Detail] Jobid:Incorrect JobId

     

  • ClientErrorMultipleDocumentsNotSupported

    The printer does not support jobs that contain more than one document. If the LastDocument element of the document is not true for the first document of the job, this error is returned.

    Fault Property Property Definition
    [Code] soap:Sender
    [Subcode] wprt:ClientErrorMultipleDocumentsNotSupported
    [Reason] Print Service does not support jobs with multiple documents.
    [Detail] None

     

  • ClientErrorLastDocumentAlreadySent

    The printer has already received a document with the LastDocument element set to true.

    Fault Property Property Definition
    [Code] soap:Sender
    [Subcode] wprt:ClientErrorLastDocumentAlreadySent
    [Reason] LastDocument already received for specified JobId
    [Detail] None

     

  • ServerErrorNotAcceptingJobs

    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

     

  • ServerErrorJobCancelled

    The job associated with this document is canceled while the document data is being transferred.

    Fault Property Property Definition
    [Code] soap:Receiver
    [Subcode] wprt:ServerErrorJobCancelled
    [Reason] Job which this document is a part of has been canceled
    [Detail] None

     

  • ClientErrorFormatNotSupported

    The supplied document Format value is not supported by the printer.

    Fault Property Property Definition
    [Code] soap:Sender
    [Subcode] wprt:ClientErrorFormatNotSupported
    [Reason] DocumentFormat parameter value not supported
    [Detail] Optional: Could return a list of supported formats

     

  • ClientErrorCompressionNotSupported

    The supplied Compression value is not supported by the printer.

    Fault Property Property Definition
    [Code] soap:Sender
    [Subcode] wprt:ClientErrorCompressionNotSupported
    [Reason] Compression parameter value not supported
    [Detail] Optional: Could return a list of supported compression values

     

In the following code example, 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 SendDocumentRequest code sample shows the required headers to format a MIME multipart/related message for inclusion of binary data in the XML request stream. Note that LastDocument is false, indicating that the client will send one or more additional SendDocumentRequest operations to the Print Service for processing with the current JobId.

mime-version: 1.0
Content-Type: multipart/related
  type=application/xop+xml
  boundary="NextPart_123_321_0000000.3E9F5D"
  start="<OperationRequest>"
  startinfo=application/soap+xml

--NextPart_123_321_0000000.3E9F5D
Content-Type: application/xop+xml; type=application/soap_xop+xml
        charset=UTF-8
Content-Transfer-Encoding: binary
Content-ID: <OperationRequest>

<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"
    xmlns:xmlmime="https://www.w3.org/2004/11/xmlmime"
    xmlns:xop="https://www.w3.org/2004/08/xop/include">
    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/SendDocument
    </wsa:Action>
    <wsa:MessageID>uuid:UniqueMsgId</wsa:MessageID>
  </soap:Header>
  <soap:Body>
    <wprt:SendDocumentRequest>
      <wprt:JobId>1</wprt:JobId>
      <wprt:DocumentDescription>
        <wprt:DocumentId>1</wprt:DocumentId>
        <wprt:Compression>None</wprt:Compression>
        <wprt:Format>application/octet-stream</wprt:Format>
        <wprt:DocumentName>Example.xml</wprt:DocumentName>
      </wprt:DocumentDescription>
      <wprt:DocumentProcessing>
        <wprt:Sides>TwoSidedLongEdge</wprt:DocumentId>
      </wprt:DocumentProcessing>
      <wprt:LastDocument>false</wprt:LastDocument>
      <wprt:DocumentData xmlmime:content-type="application/octet-stream">
        <xop:Include href="cid:000001" />
      </wprt:DocumentData>
    </wprt:SendDocumentRequest>
  </soap:Body>
</soap:Envelope>

--NextPart_123_321_0000000.3E9F5D

Content-Type: application/octet-stream;
Content-Transfer-Encoding: binary
Content-ID: <000001>

<BINARY DATA GOES HERE> Document PDL Data

--NextPart_123_321_0000000.3E9F5D--

See also

CreatePrintJobResponse

DocumentData

DocumentDescription

DocumentProcessing

JobId

LastDocument

SendDocumentResponse

 

 

Send comments about this topic to Microsoft

Build date: 7/19/2012