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: Print, PrintOperation, PrintAsUser, PrintAsComputer, PrintAsGoodsOwner, PrintResponse, PrintResult, PrintError, PrintFileResult

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

Print
UserName string(50) Req. Your username
Password string(50) Req. Your password
Operation PrintOperation Req. The operation object
PrintOperation
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 PrintAsUser 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.
PrintAsComputer PrintAsComputer 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.
PrintAsGoodsOwner PrintAsGoodsOwner 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.
PrintAsUser
UserName string The user name.
UserId int The user id.
PrintAsComputer
ComputerName string The computer name.
ComputerId int The computer ID.
PrintAsGoodsOwner
GoodsOwnerId int The goods owner ID.

Response XML

<?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

PrintResponse
PrintResult PrintResult
PrintResult
Success boolean 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 string Message.
Error PrintError A list of PrintErrorType objects
PrintFileResults PrintFileResult[] A PrintFileResult object.
PrintError
Message string Message explaining the error.
ErrorType enum The type of error:
  • UnknownError
  • LogonError
  • ReportIdNotFound
  • UserNotFound
  • ComputerNotFound
  • GoodsOwnerNotFound
  • ErrorWhilePrinting
PrintFileResult
Bytes base64Binary The printed file, encoded in Base64.
MimeType string The Mime type of the file.
ByteType enum Ongoing WMS' own classification of the file type.