CreatePrintJob

Ongoing WMS has a printer service which can be used to trigger printouts in the warehouse. This function allows you to add printouts to the print queue.

This function does not return the actual printed file. If you need the file itself, use Print instead.

Tags: CreatePrintJob, AutomationPrintJob, AutomationPrintJobUser, AutomationPrintJobComputer, AutomationPrintJobGoodsOwner, CreatePrintJobResponse, CreatePrintJobResult, CreatePrintJobError

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/CreatePrintJob"

<?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>
    <CreatePrintJob xmlns="http://ongoingsystems.se/Automation">
      <UserName>string</UserName>
      <Password>string</Password>
      <PrintJob>
        <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>
      </PrintJob>
    </CreatePrintJob>
  </soap:Body>
</soap:Envelope>

Request specification

CreatePrintJob
UserName string(50) Req. Your username
Password string(50) Req. Your password
PrintJob AutomationPrintJob Req. Object of type PrintJob. Defines the print job that you want to create.
AutomationPrintJob
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 AutomationPrintJobUser If you specify this object, then the printouts will be added to the queue as if they were coming from the the specified user. This can affect which printer is used.
PrintAsComputer AutomationPrintJobComputer 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 AutomationPrintJobGoodsOwner 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.
AutomationPrintJobUser
UserName string The user name.
UserId int The user id.
AutomationPrintJobComputer
ComputerName string The computer name.
ComputerId int The computer ID.
AutomationPrintJobGoodsOwner
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>
    <CreatePrintJobResponse xmlns="http://ongoingsystems.se/Automation">
      <CreatePrintJobResult>
        <Success>boolean</Success>
        <PrintJobId>int</PrintJobId>
        <Message>string</Message>
        <Errors>
          <CreatePrintJobError>
            <Message>string</Message>
            <ErrorType>UnknownError or LogonError or ReportIdNotFound or UserNotFound or ComputerNotFound or PrinterNotFound or GoodsOwnerNotFound</ErrorType>
          </CreatePrintJobError>
          <CreatePrintJobError>
            <Message>string</Message>
            <ErrorType>UnknownError or LogonError or ReportIdNotFound or UserNotFound or ComputerNotFound or PrinterNotFound or GoodsOwnerNotFound</ErrorType>
          </CreatePrintJobError>
        </Errors>
      </CreatePrintJobResult>
    </CreatePrintJobResponse>
  </soap:Body>
</soap:Envelope>

Response specification

CreatePrintJobResponse
CreatePrintJobResult CreatePrintJobResult
CreatePrintJobResult
Success boolean True if successful, false otherwise.
PrintJobId int The ID of the print job.
Message string Message.
Errors CreatePrintJobError[] A list of CreatePrintJobError objects
CreatePrintJobError
Message string Message explaining the error.
ErrorType enum The type of error:
  • UnknownError
  • LogonError
  • ReportIdNotFound
  • UserNotFound
  • ComputerNotFound
  • PrinterNotFound
  • GoodsOwnerNotFound