# railalefan/phpopenldbws architecture

> Architecture diagram of the GitHub repository railalefan/phpopenldbws, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/railalefan/phpopenldbws
- Repository: https://github.com/railalefan/phpopenldbws

## Overview

phpOpenLDBWS is a small PHP wrapper for National Rail Enquiries' OpenLDBWS SOAP API. A caller creates the client with an access token, invokes a board or service-details method, and receives the SOAP response object (or FALSE on a caught fault); examples either print it or render departure rows. The source shows request setup, shared SOAP dispatch, and fault tracing in one file. The README documents the full API; examples demonstrate only selected calls. The repository is tiny, so the graph focuses on actual runtime behavior rather than a broader subsystem map.

Main entry points: [`OpenLDBWS.php`](https://github.com/railalefan/phpopenldbws/blob/master/OpenLDBWS.php) (OpenLDBWS API), [`example1.php`](https://github.com/railalefan/phpopenldbws/blob/master/example1.php) (Board example), [`example2.php`](https://github.com/railalefan/phpopenldbws/blob/master/example2.php) (Fastest example), [`example3.php`](https://github.com/railalefan/phpopenldbws/blob/master/example3.php) (HTML table example)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["PHP client"]
  node_client_api["OpenLDBWS API<br/>[OpenLDBWS.php]"]
  node_board_params["Board requests<br/>[OpenLDBWS.php]"]
  node_departure_params["Departure requests<br/>[OpenLDBWS.php]"]
  node_service_details["Service details<br/>[OpenLDBWS.php]"]
  node_soap_dispatch["SOAP dispatch<br/>[OpenLDBWS.php]"]
  node_soap_fault["Fault tracing<br/>[OpenLDBWS.php]"]
end

subgraph group_samples["Usage examples"]
  node_example1["Board example<br/>[example1.php]"]
  node_example2["Fastest example<br/>[example2.php]"]
  node_example3["HTML table example<br/>[example3.php]"]
end

subgraph group_service["External service"]
  node_openldbws{{"OpenLDBWS SOAP"}}
end

node_caller(("PHP caller"))
node_response["SOAP response"]

node_caller -->|"creates client"| node_client_api
node_client_api -->|"configures SOAP"| node_openldbws
node_client_api -->|"routes board calls"| node_board_params
node_client_api -->|"routes departure calls"| node_departure_params
node_client_api -->|"builds details request"| node_service_details
node_board_params -->|"calls"| node_soap_dispatch
node_departure_params -->|"calls"| node_soap_dispatch
node_service_details -->|"calls"| node_soap_dispatch
node_soap_dispatch -->|"sends SOAP request"| node_openldbws
node_openldbws -->|"returns response"| node_soap_dispatch
node_soap_dispatch -->|"handles faults"| node_soap_fault
node_soap_dispatch -->|"returns object or FALSE"| node_response
node_example1 -->|"requests board"| node_client_api
node_example2 -->|"requests fastest"| node_client_api
node_example3 -->|"requests board"| node_client_api
node_example1 -->|"prints result"| node_response
node_example2 -->|"prints result"| node_response
node_example3 -->|"renders rows"| node_response

click node_client_api "https://github.com/railalefan/phpopenldbws/blob/master/OpenLDBWS.php"
click node_board_params "https://github.com/railalefan/phpopenldbws/blob/master/OpenLDBWS.php"
click node_departure_params "https://github.com/railalefan/phpopenldbws/blob/master/OpenLDBWS.php"
click node_service_details "https://github.com/railalefan/phpopenldbws/blob/master/OpenLDBWS.php"
click node_soap_dispatch "https://github.com/railalefan/phpopenldbws/blob/master/OpenLDBWS.php"
click node_soap_fault "https://github.com/railalefan/phpopenldbws/blob/master/OpenLDBWS.php"
click node_example1 "https://github.com/railalefan/phpopenldbws/blob/master/example1.php"
click node_example2 "https://github.com/railalefan/phpopenldbws/blob/master/example2.php"
click node_example3 "https://github.com/railalefan/phpopenldbws/blob/master/example3.php"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_client_api,node_board_params,node_departure_params,node_service_details,node_soap_dispatch,node_soap_fault toneBlue
class node_example1,node_example2,node_example3 toneAmber
class node_openldbws toneMint
class node_caller,node_response toneIndigo
```

## Components

### PHP client

- [OpenLDBWS API](https://github.com/railalefan/phpopenldbws/blob/master/OpenLDBWS.php): `OpenLDBWS.php`
- [Board requests](https://github.com/railalefan/phpopenldbws/blob/master/OpenLDBWS.php): `OpenLDBWS.php`
- [Departure requests](https://github.com/railalefan/phpopenldbws/blob/master/OpenLDBWS.php): `OpenLDBWS.php`
- [Service details](https://github.com/railalefan/phpopenldbws/blob/master/OpenLDBWS.php): `OpenLDBWS.php`
- [SOAP dispatch](https://github.com/railalefan/phpopenldbws/blob/master/OpenLDBWS.php): `OpenLDBWS.php`
- [Fault tracing](https://github.com/railalefan/phpopenldbws/blob/master/OpenLDBWS.php): `OpenLDBWS.php`

### Usage examples

- [Board example](https://github.com/railalefan/phpopenldbws/blob/master/example1.php): `example1.php`
- [Fastest example](https://github.com/railalefan/phpopenldbws/blob/master/example2.php): `example2.php`
- [HTML table example](https://github.com/railalefan/phpopenldbws/blob/master/example3.php): `example3.php`

### External service

- **OpenLDBWS SOAP**

### Other components

- **PHP caller**
- **SOAP response**

## Connections

- PHP caller → OpenLDBWS API: creates client (evidence: `README.md`)
- OpenLDBWS API → OpenLDBWS SOAP: configures SOAP (evidence: `OpenLDBWS.php`)
- OpenLDBWS API → Board requests: routes board calls (evidence: `OpenLDBWS.php`)
- OpenLDBWS API → Departure requests: routes departure calls (evidence: `OpenLDBWS.php`)
- OpenLDBWS API → Service details: builds details request (evidence: `OpenLDBWS.php`)
- Board requests → SOAP dispatch: calls (evidence: `OpenLDBWS.php`)
- Departure requests → SOAP dispatch: calls (evidence: `OpenLDBWS.php`)
- Service details → SOAP dispatch: calls (evidence: `OpenLDBWS.php`)
- SOAP dispatch → OpenLDBWS SOAP: sends SOAP request (evidence: `OpenLDBWS.php`)
- OpenLDBWS SOAP → SOAP dispatch: returns response (evidence: `OpenLDBWS.php`)
- SOAP dispatch → Fault tracing: handles faults (evidence: `OpenLDBWS.php`)
- SOAP dispatch → SOAP response: returns object or FALSE (evidence: `OpenLDBWS.php`)
- Board example → OpenLDBWS API: requests board (evidence: `example1.php`)
- Fastest example → OpenLDBWS API: requests fastest (evidence: `example2.php`)
- HTML table example → OpenLDBWS API: requests board (evidence: `example3.php`)
- Board example → SOAP response: prints result (evidence: `example1.php`)
- Fastest example → SOAP response: prints result (evidence: `example2.php`)
- HTML table example → SOAP response: renders rows (evidence: `example3.php`)
