Gateway
The HanelWarehouseGateway class is the single entry point for all interactions with the Hanel warehouse. It hides all SOAP, HTTP, and XML details.
HanelWarehouseGateway
Gateway for the Hanel automatic warehouse via SOAP.
The module is not thread-safe. For concurrent calls, instantiate one client per thread.
Example
config = GatewayConfig.from_env() gateway = HanelWarehouseGateway(config) gateway.register_article("1001", "M6 stainless bolt")
register_article
register_article(
article_number: str,
article_name: str,
batch_number: str | None = None,
) -> bool
Register or update an article in the warehouse catalogue.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
article_number
|
str
|
Unique article code (max 40 chars, alphanumeric only). |
required |
article_name
|
str
|
Article description (max 40 chars). |
required |
batch_number
|
str | None
|
Lot/batch number (max 40 chars). Only used when lot_management_enabled=True in GatewayConfig. |
None
|
Returns:
| Type | Description |
|---|---|
bool
|
True if the operation succeeded (returnValue == 0). |
send_movement_order
send_movement_order(
order_number: str, positions: list[MovementLine]
) -> bool
Send a movement order (pick or load) to the warehouse.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
order_number
|
str
|
Unique order identifier (max 40 chars). |
required |
positions
|
list[MovementLine]
|
List of movement lines (at least one element). |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if the operation succeeded (returnValue == 0). |
get_completed_movements
get_completed_movements() -> list[MovementResult]
Retrieve completed orders from the warehouse.
If actual_quantity < nominal_quantity in a line, stock was insufficient: handling is the caller's responsibility.
get_all_orders
get_all_orders() -> list[MovementResult]
Retrieve all orders currently in the warehouse queue.
get_inventory
get_inventory() -> list[StockRecord]
Retrieve stock levels for all articles in the warehouse.
Only mechanism to detect manual movements performed at the warehouse console.
cancel_order
cancel_order(order_number: str) -> bool
Cancel an order from the warehouse queue.
Applicable only to orders not yet processed (status 0).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
order_number
|
str
|
Identifier of the order to cancel (max 40 chars). |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if the operation succeeded (returnValue == 0). |
ping
ping() -> bool
Check whether the warehouse t-Server is reachable.
Lightweight connectivity probe that sends a read-only request with a single attempt and a capped timeout, so an unreachable server fails fast instead of blocking for the full retry sequence. Returns True if the server responds with any HTTP reply, False if it cannot be reached over the network. Does not raise on an unreachable server.