Print

This API function allows you print a report in Ongoing WMS. The resulting file is returned in the response.

If you want to trigger a printout at a printer inside the warehouse, consider using CreatePrintJob instead.

Tags: CreatePrintJob, Operation, PrintResult, PrintFileResult, PrintErrorType

Request XML

POST /xxx/automation.asmx HTTP/1.1
Host: api.ongoingsystems.se
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://ongoingsystems.se/Automation/Print"

<?xml version="1.0" encoding="utf-8" ?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <Print xmlns="http://ongoingsystems.se/Automation">
      <UserName>string</UserName>
      <Password>string</Password>
      <Operation>
        <ReportId>int</ReportId>
        <IdsToPrint>
          <int>int</int>
          <int>int</int>
        </IdsToPrint>
        <PrintAsUser>
          <UserName>string</UserName>
          <UserId>int</UserId>
        </PrintAsUser>
        <PrintAsComputer>
          <ComputerName>string</ComputerName>
          <ComputerId>int</ComputerId>
        </PrintAsComputer>
        <PrintAsGoodsOwner>
          <GoodsOwnerId>int</GoodsOwnerId>
        </PrintAsGoodsOwner>
      </Operation>
    </Print>
  </soap:Body>
</soap:Envelope>

Request specification

CreatePrintJob
UserName str(50) Req. Your username.
Password str(50) Req. Your password.
Operation obj Req. Object of type Operation. Defines which document you want to create.
Operation
ReportId int Req. The report which will be printed. Ask the warehouse to provide you with this ID.
> IdsToPrint int[] Req. The IDs of the things you want to print. For instance, if you want to print delivery note for some orders, then this list should contain a list of OrderIds.
PrintAsUser obj If you specify this object, then the printouts will be added to the queue as if they were coming from the specified user. This can affect which printer is used.
> UserName str The user name.
> UserId int The user id.
PrintAsComputer obj If you specify this object, then the printouts will be added to the queue as if they were coming from the specified computer. This can affect which printer is used.
> ComputerName str The computer name.
> ComputerId int The computer ID.
PrintAsGoodsOwner obj If you specify this object, then the printouts will be added to the queue as if they were coming from the specified goods owner. This can affect which printer is used.
> GoodsOwnerId int The goods owner ID.

Response XML

HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8" ?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <PrintResponse xmlns="http://ongoingsystems.se/Automation">
      <PrintResult>
        <Success>boolean</Success>
        <ReportId>int</ReportId>
        <PrintLogId>int</PrintLogId>
        <Message>string</Message>
        <Error>
          <Message>string</Message>
          <ErrorType>UnknownError or LogonError or ReportIdNotFound or UserNotFound or ComputerNotFound or GoodsOwnerNotFound or ErrorWhilePrinting</ErrorType>
        </Error>
        <PrintFileResults>
          <PrintFileResult>
            <Bytes>base64Binary</Bytes>
            <MimeType>string</MimeType>
            <ByteType>PDF or ZPL or XLSX or CSV or XLS or DOC or EPL or OTHER or DOCX or TXT or JPG or SVG</ByteType>
          </PrintFileResult>
          <PrintFileResult>
            <Bytes>base64Binary</Bytes>
            <MimeType>string</MimeType>
            <ByteType>PDF or ZPL or XLSX or CSV or XLS or DOC or EPL or OTHER or DOCX or TXT or JPG or SVG</ByteType>
          </PrintFileResult>
        </PrintFileResults>
      </PrintResult>
    </PrintResponse>
  </soap:Body>
</soap:Envelope>

Response specification

PrintResult
Success bool True if successful, false otherwise.
ReportId int The ID of the report which was printed.
PrintLogId int The ID for Ongoing WMS logging of the printout.
Message str Message.
Errors object A list of PrintErrorType objects
PrintFileResult object A PrintFileResult object.
PrintFileResult
Bytes base64Binary The printed file, encoded in Base64.
ReportId int The ID of the report which was printed.
MimeType str The Mime type of the file.
ByteType enum Ongoing WMS' own classification of the file type.
PrintErrorType
Message str(*) Message explaining the error.
ErrorType string The type of error:
  • UnknownError
  • LogonError
  • ReportIdNotFound
  • UserNotFound
  • ComputerNotFound
  • GoodsOwnerNotFound
  • ErrorWhilePrinting