### Project Setup Source: https://github.com/techspokes/typescript-wsdl-client/blob/main/examples/typescript-project/README.md Installs necessary npm packages for the TypeScript project. ```bash npm init -y npm install soap npm install -D tsx typescript @types/node ``` -------------------------------- ### Verify Setup Source: https://github.com/techspokes/typescript-wsdl-client/blob/main/SUPPORT.md Commands to verify the project setup. ```bash npm run smoke:pipeline ``` ```bash npm run ci ``` -------------------------------- ### Quick Start - npm install and start Source: https://github.com/techspokes/typescript-wsdl-client/blob/main/docs/cli-reference.md Steps to install dependencies and start the generated Fastify application. ```bash cd app/ npm install cp .env.example .env # Edit .env — set WSDL_SOURCE to your WSDL URL npm start ``` -------------------------------- ### Example Command Usage Source: https://github.com/techspokes/typescript-wsdl-client/blob/main/SUPPORT.md An example of how to use the wsdl-tsc pipeline command. ```bash npx wsdl-tsc pipeline --wsdl-source your-service.wsdl --client-dir ./generated ``` -------------------------------- ### Multi-Service Setup with Fastify Source: https://github.com/techspokes/typescript-wsdl-client/blob/main/docs/gateway-guide.md Example of integrating multiple SOAP services with Fastify, registering each in its own encapsulation scope to prevent decorator collisions. ```typescript import Fastify from "fastify"; import weatherPlugin from "./generated/weather/gateway/plugin.js"; import inventoryPlugin from "./generated/inventory/gateway/plugin.js"; import { Weather } from "./generated/weather/client/client.js"; import { Inventory } from "./generated/inventory/client/client.js"; const app = Fastify({ logger: true }); // Each plugin gets its own scope to isolate decorators await app.register(async (scope) => { await scope.register(weatherPlugin, { client: new Weather({ source: "https://example.com/weather?wsdl" }), prefix: "/api/weather", }); }); await app.register(async (scope) => { await scope.register(inventoryPlugin, { client: new Inventory({ source: "https://example.com/inventory?wsdl" }), prefix: "/api/inventory", }); }); await app.listen({ port: 3000 }); ``` -------------------------------- ### App Command Example Source: https://github.com/techspokes/typescript-wsdl-client/blob/main/docs/cli-reference.md Example of the `app` command to scaffold a runnable server. ```bash npx wsdl-tsc app --client-dir ./client --gateway-dir ./gw --openapi-file ./api.json ``` -------------------------------- ### Regenerate Examples Source: https://github.com/techspokes/typescript-wsdl-client/blob/main/examples/README.md Command to regenerate examples from the repository root. ```bash npm run examples:regenerate ``` -------------------------------- ### Multi-Service Application Setup Source: https://github.com/techspokes/typescript-wsdl-client/blob/main/examples/fastify-gateway/README.md TypeScript code for a Fastify application that registers multiple generated gateway plugins (Weather and Inventory) within separate encapsulation scopes to prevent decorator collisions. ```typescript import Fastify from "fastify"; import weatherPlugin from "./generated/weather/gateway/plugin.js"; import inventoryPlugin from "./generated/inventory/gateway/plugin.js"; import { Weather } from "./generated/weather/client/client.js"; import { Inventory } from "./generated/inventory/client/client.js"; const app = Fastify({ logger: true }); const weatherClient = new Weather({ source: "https://example.com/weather?wsdl", }); const inventoryClient = new Inventory({ source: "https://example.com/inventory?wsdl", }); // Each service is registered in its own encapsulation scope // to prevent decorator name collisions await app.register(async (scope) => { await scope.register(weatherPlugin, { client: weatherClient, prefix: "/api/weather", }); }); await app.register(async (scope) => { await scope.register(inventoryPlugin, { client: inventoryClient, prefix: "/api/inventory", }); }); await app.listen({ port: 3000 }); ``` -------------------------------- ### Pipeline Command with Configuration Files Source: https://github.com/techspokes/typescript-wsdl-client/blob/main/examples/config/README.md Example of how to pass configuration files to the pipeline command. ```bash npx wsdl-tsc pipeline \ --wsdl-source https://example.com/service?wsdl \ --client-dir ./generated/client \ --openapi-file ./generated/openapi.json \ --gateway-dir ./generated/gateway \ --gateway-service-name my-service \ --gateway-version-prefix v1 \ --openapi-security-config-file ./config/security.json \ --openapi-tags-file ./config/tags.json \ --openapi-ops-file ./config/ops.json ``` -------------------------------- ### Verify Setup Source: https://github.com/techspokes/typescript-wsdl-client/blob/main/CONTRIBUTING.md Command to verify the project setup. ```bash npm run ci ``` -------------------------------- ### End-to-End Example Source: https://github.com/techspokes/typescript-wsdl-client/blob/main/docs/api-reference.md Example demonstrating the end-to-end generation pipeline with stream configuration, OpenAPI generation, and gateway setup. ```typescript import { loadStreamConfigFile, runGenerationPipeline, } from "@techspokes/typescript-wsdl-client"; const streamConfig = loadStreamConfigFile("./stream.config.json"); const { compiled, openapiDoc } = await runGenerationPipeline({ wsdl: "./wsdl/Service.wsdl", catalogOut: "./build/service-catalog.json", clientOutDir: "./src/services/service", compiler: { imports: "js" }, openapi: { outFile: "./docs/service-api.json", format: "json", servers: ["https://api.example.com/v1"], }, gateway: { outDir: "./src/gateway/service", versionSlug: "v1", serviceSlug: "service", }, streamConfig, }); const streamOp = compiled.operations.find((op) => op.stream); console.log(streamOp?.stream?.mediaType); // "application/x-ndjson" ``` -------------------------------- ### Client and OpenAPI Only Example Source: https://github.com/techspokes/typescript-wsdl-client/blob/main/docs/cli-reference.md Example command to generate only client and OpenAPI files. ```bash npx wsdl-tsc pipeline \ --wsdl-source https://example.com/Hotel.wsdl \ --client-dir ./build/client \ --openapi-file ./docs/hotel-api.json \ --openapi-format both ``` -------------------------------- ### Test Suite Example Source: https://github.com/techspokes/typescript-wsdl-client/blob/main/docs/cli-reference.md Example command to run the pipeline with generated test suite. ```bash npx wsdl-tsc pipeline \ --wsdl-source examples/minimal/weather.wsdl \ --client-dir tmp/client \ --openapi-file tmp/openapi.json \ --gateway-dir tmp/gateway \ --gateway-service-name weather \ --gateway-version-prefix v1 \ --test-dir tmp/tests ``` -------------------------------- ### Run and test the generated application Source: https://github.com/techspokes/typescript-wsdl-client/blob/main/README.md Navigate to the generated app directory, install dependencies, set up environment variables, start the application, and test endpoints. ```bash cd generated/app && npm install && cp .env.example .env && npm start ``` ```bash curl http://localhost:3000/health curl http://localhost:3000/openapi.json | jq . curl -X POST http://localhost:3000/get-weather-information \ -H "Content-Type: application/json" -d '{}' ``` -------------------------------- ### Complete Stack Example Source: https://github.com/techspokes/typescript-wsdl-client/blob/main/docs/cli-reference.md Example command to run the full pipeline including client, OpenAPI, and gateway generation. ```bash npx wsdl-tsc pipeline \ --wsdl-source examples/minimal/weather.wsdl \ --client-dir tmp/client \ --openapi-file tmp/openapi.json \ --gateway-dir tmp/gateway \ --gateway-service-name weather \ --gateway-version-prefix v1 ``` -------------------------------- ### Using the Mock with Fastify Source: https://github.com/techspokes/typescript-wsdl-client/blob/main/docs/testing.md Example of integrating a mock client with Fastify for testing API endpoints. ```typescript import Fastify from "fastify"; const app = Fastify(); await app.register(weatherGateway, { client: createMockClient(), prefix: "/v1/weather", }); await app.ready(); const res = await app.inject({ method: "POST", url: "/v1/weather/get-city-weather-by-zip", payload: { ZIP: "10001" }, }); expect(res.statusCode).toBe(200); expect(res.json().status).toBe("SUCCESS"); ``` -------------------------------- ### Pipeline Command Example Source: https://github.com/techspokes/typescript-wsdl-client/blob/main/docs/cli-reference.md Example of the `pipeline` command for a comprehensive build process. ```bash npx wsdl-tsc pipeline --wsdl-source svc.wsdl --client-dir ./client --openapi-file ./api.json --gateway-dir ./gw --gateway-service-name svc --gateway-version-prefix v1 ``` -------------------------------- ### Client Command Example Source: https://github.com/techspokes/typescript-wsdl-client/blob/main/docs/cli-reference.md Example of the `client` command to generate only a TypeScript client. ```bash npx wsdl-tsc client --wsdl-source svc.wsdl --client-dir ./client ``` -------------------------------- ### Mock Client Pattern Source: https://github.com/techspokes/typescript-wsdl-client/blob/main/docs/testing.md Example of creating a mock client for integration tests using the generated 'operations.ts' interface. ```typescript import type { WeatherOperations } from "../client/operations.js"; function createMockClient(): WeatherOperations { return { GetCityWeatherByZIP: async (args) => ({ response: { GetCityWeatherByZIPResult: { Success: true, ResponseText: "City Found", State: "NY", City: "New York", Temperature: "72", }, }, headers: {}, }), GetCityForecastByZIP: async (args) => ({ response: { GetCityForecastByZIPResult: { Success: true, ResponseText: "Forecast Found", // Use SOAP wrapper shape — unwrapArrayWrappers() handles conversion ForecastResult: { Forecast: [] }, }, }, headers: {}, }), GetWeatherInformation: async (args) => ({ response: { // Use SOAP wrapper shape — unwrapArrayWrappers() handles conversion GetWeatherInformationResult: { WeatherDescription: [] }, }, headers: {}, }), }; } ``` -------------------------------- ### Compile Command Example Source: https://github.com/techspokes/typescript-wsdl-client/blob/main/docs/cli-reference.md Example of the `compile` command for debugging WSDL. ```bash npx wsdl-tsc compile --wsdl-source svc.wsdl --catalog-file ./catalog.json ``` -------------------------------- ### Client Command Usage Source: https://github.com/techspokes/typescript-wsdl-client/blob/main/docs/cli-reference.md Usage examples for the 'client' command. ```bash npx wsdl-tsc client --wsdl-source --client-dir [options] npx wsdl-tsc client --catalog-file --client-dir [options] ``` -------------------------------- ### CLI Help Reference Source: https://github.com/techspokes/typescript-wsdl-client/blob/main/SUPPORT.md Commands to get help for the wsdl-tsc CLI tool. ```bash npx wsdl-tsc --help ``` ```bash npx wsdl-tsc --help ``` -------------------------------- ### Clone and Install Source: https://github.com/techspokes/typescript-wsdl-client/blob/main/CONTRIBUTING.md Steps to clone the repository and install dependencies. ```bash git clone https://github.com/techspokes/typescript-wsdl-client.git cd typescript-wsdl-client npm install ``` -------------------------------- ### Usage Example Source: https://github.com/techspokes/typescript-wsdl-client/blob/main/examples/typescript-project/README.md Demonstrates how to import and use the generated SOAP client in a TypeScript file. ```typescript import { Weather } from "./generated/client/client.js"; const client = new Weather({ source: "https://example.com/service?wsdl", }); const result = await client.GetCityWeatherByZIP({ ZIP: "10001", }); console.log(result); ``` -------------------------------- ### Gateway Command Example Source: https://github.com/techspokes/typescript-wsdl-client/blob/main/docs/cli-reference.md Example of the `gateway` command to generate only a REST gateway. ```bash npx wsdl-tsc gateway --openapi-file ./api.json --client-dir ./client --gateway-dir ./gw --gateway-service-name svc --gateway-version-prefix v1 ``` -------------------------------- ### loadStreamConfigFile Example Source: https://github.com/techspokes/typescript-wsdl-client/blob/main/docs/api-reference.md Example of loading a stream configuration file from disk. ```typescript import { loadStreamConfigFile } from "@techspokes/typescript-wsdl-client"; const streamConfig = loadStreamConfigFile("./stream.config.json"); ``` -------------------------------- ### Running the Project Source: https://github.com/techspokes/typescript-wsdl-client/blob/main/examples/typescript-project/README.md Command to run the TypeScript project using tsx. ```bash npx tsx src/index.ts ``` -------------------------------- ### Environment Details - Node.js Version Source: https://github.com/techspokes/typescript-wsdl-client/blob/main/SUPPORT.md Command to get the Node.js version. ```bash node --version ``` -------------------------------- ### OpenAPI Command Example Source: https://github.com/techspokes/typescript-wsdl-client/blob/main/docs/cli-reference.md Example of the `openapi` command to generate only an OpenAPI specification. ```bash npx wsdl-tsc openapi --wsdl-source svc.wsdl --openapi-file ./api.json ``` -------------------------------- ### Generate Test Suite Source: https://github.com/techspokes/typescript-wsdl-client/blob/main/docs/testing.md Generates a ready-to-run test suite for consumer projects. ```bash npx wsdl-tsc pipeline --test-dir ./tests ``` -------------------------------- ### App Command Usage Source: https://github.com/techspokes/typescript-wsdl-client/blob/main/docs/cli-reference.md Usage example for the `app` command to scaffold a runnable Fastify application. ```bash npx wsdl-tsc app \ --client-dir \ --gateway-dir \ --openapi-file \ [--app-dir ] \ [options] ``` -------------------------------- ### Minimal stream.config.json Source: https://github.com/techspokes/typescript-wsdl-client/blob/main/docs/start-here.md Minimal `stream.config.json` for streaming large SOAP responses. ```json { "operations": { "MyStreamOp": { "recordType": "MyRecordType", "recordPath": ["MyStreamOpResponse", "Records", "Record"] } } } ``` -------------------------------- ### Run Test Suite Source: https://github.com/techspokes/typescript-wsdl-client/blob/main/docs/testing.md Runs the generated test suite using Vitest. ```bash npx vitest run --config ./tests/vitest.config.ts ``` -------------------------------- ### Stream Configuration Example Source: https://github.com/techspokes/typescript-wsdl-client/blob/main/docs/migration-playbook.md Author a stream config naming those operations. ```json { "operations": { "MyBatchOp": { "recordType": "MyRecordType", "recordPath": ["MyBatchOpResponse", "Records", "Record"] } } } ``` -------------------------------- ### Generated Output Command Source: https://github.com/techspokes/typescript-wsdl-client/blob/main/examples/README.md Command to generate output from a local WSDL file. ```bash npx wsdl-tsc pipeline \ --wsdl-source examples/minimal/weather.wsdl \ --client-dir examples/generated-output/client \ --openapi-file examples/generated-output/openapi.json \ --gateway-dir examples/generated-output/gateway \ --gateway-service-name weather \ --gateway-version-prefix v1 ``` -------------------------------- ### runGenerationPipeline Example Source: https://github.com/techspokes/typescript-wsdl-client/blob/main/docs/api-reference.md Example of running the complete generation pipeline including client, OpenAPI, and gateway generation. ```typescript import { runGenerationPipeline } from "@techspokes/typescript-wsdl-client"; const { compiled, openapiDoc } = await runGenerationPipeline({ wsdl: "./wsdl/Hotel.wsdl", catalogOut: "./build/hotel-catalog.json", clientOutDir: "./src/services/hotel", compiler: { imports: "js", primitive: { int64As: "number", decimalAs: "string" } }, openapi: { outFile: "./docs/hotel-api.json", format: "both", servers: ["https://api.example.com/v1"], tagStyle: "service" }, gateway: { outDir: "./src/gateway/hotel", versionSlug: "v1", serviceSlug: "hotel" } }); ``` -------------------------------- ### Generate Typed Client Source: https://github.com/techspokes/typescript-wsdl-client/blob/main/docs/migration-playbook.md Start by generating a typed client from your WSDL. ```bash npx wsdl-tsc client \ --wsdl-source https://your-service.example.com/service.svc?wsdl \ --client-dir ./generated/client ``` -------------------------------- ### Gateway Generation Usage Source: https://github.com/techspokes/typescript-wsdl-client/blob/main/docs/cli-reference.md Usage example for generating a Fastify gateway from an OpenAPI specification. ```bash npx wsdl-tsc gateway \ --openapi-file \ --client-dir \ --gateway-dir \ --gateway-service-name \ --gateway-version-prefix \ [options] ``` -------------------------------- ### Scaffolded App Alternative Source: https://github.com/techspokes/typescript-wsdl-client/blob/main/examples/fastify-gateway/README.md Command to scaffold a complete runnable application for a single service using the `--init-app` flag. ```bash npx wsdl-tsc pipeline \ --wsdl-source https://example.com/weather?wsdl \ --client-dir ./generated/client \ --openapi-file ./generated/openapi.json \ --gateway-dir ./generated/gateway \ --gateway-service-name weather \ --gateway-version-prefix v1 \ --init-app ``` -------------------------------- ### Streaming Handlers Source: https://github.com/techspokes/typescript-wsdl-client/blob/main/docs/gateway-guide.md Example of a generated handler for streaming operations that emit NDJSON. ```typescript import type { FastifyInstance } from "fastify"; import type { GetWeatherInformation } from "../../client/types.js"; import schema from "../schemas/operations/getweatherinformation.json" with { type: "json" }; import { toNdjson } from "../runtime.js"; // Response schema omitted: stream operations emit NDJSON, not a single JSON object const { response: _response, ...routeSchema } = schema as Record; export async function registerRoute_v1_weather_getweatherinformation(fastify: FastifyInstance) { fastify.route<{ Body: GetWeatherInformation }>({ method: "POST", url: "/get-weather-information", schema: routeSchema, handler: async (request, reply) => { const client = fastify.weatherClient; const result = await client.GetWeatherInformation(request.body as GetWeatherInformation); reply.type("application/x-ndjson"); return reply.send(toNdjson(result.records)); }, }); } ``` -------------------------------- ### Writing Unit Tests Source: https://github.com/techspokes/typescript-wsdl-client/blob/main/docs/testing.md Example of a Vitest unit test for the 'pascal' utility function. ```typescript import { describe, it, expect } from "vitest"; import { pascal } from "../../src/util/tools.js"; describe("pascal", () => { it("converts kebab-case", () => { expect(pascal("get-weather")).toBe("GetWeather"); }); }); ``` -------------------------------- ### Generate a REST gateway over SOAP Source: https://github.com/techspokes/typescript-wsdl-client/blob/main/docs/start-here.md Run the `pipeline` command with `--init-app`. This generates the typed client, OpenAPI spec, Fastify gateway handlers, and a runnable application in one step. ```bash npx wsdl-tsc pipeline \ --wsdl-source your-service.wsdl \ --client-dir ./generated/client \ --openapi-file ./generated/openapi.json \ --gateway-dir ./generated/gateway \ --gateway-service-name my-service \ --gateway-version-prefix v1 \ --init-app ``` -------------------------------- ### Mock Client for Stream Operations Source: https://github.com/techspokes/typescript-wsdl-client/blob/main/docs/testing.md Example of creating a mock client for a stream operation, returning an async iterable of records. ```typescript const client = createMockClient({ UnitDescriptiveInfoStream: async () => ({ records: (async function* () { yield { Id: "1", Name: "Villa A" }; yield { Id: "2", Name: "Villa B" }; })(), headers: {}, }), }); ``` -------------------------------- ### Mock Client with Specific Operation Override Source: https://github.com/techspokes/typescript-wsdl-client/blob/main/docs/testing.md Example of creating a mock client and overriding a specific operation (GetCityWeatherByZIP) with a custom response. ```typescript import { createMockClient } from "./helpers/mock-client.js"; const client = createMockClient({ GetCityWeatherByZIP: async () => ({ response: { GetCityWeatherByZIPResult: { Success: false, WeatherID: 0 } }, headers: {}, }), }); ``` -------------------------------- ### Using a Remote WSDL Source: https://github.com/techspokes/typescript-wsdl-client/blob/main/examples/README.md Command to generate client and gateway from a remote WSDL URL, including scaffolding a Fastify application. ```bash npx wsdl-tsc pipeline \ --wsdl-source https://example.com/service?wsdl \ --client-dir ./generated/client \ --openapi-file ./generated/openapi.json \ --gateway-dir ./generated/gateway \ --gateway-service-name my-service \ --gateway-version-prefix v1 \ --init-app ``` -------------------------------- ### Installation Source: https://github.com/techspokes/typescript-wsdl-client/blob/main/docs/agent-skill.md Command to install the agent skill. ```bash node install.mjs --target ./skills ``` -------------------------------- ### Generating Multiple Services Source: https://github.com/techspokes/typescript-wsdl-client/blob/main/examples/fastify-gateway/README.md Commands to generate separate clients, gateway plugins, and OpenAPI specs for two distinct services (Weather and Inventory) using the wsdl-tsc pipeline. ```bash npx wsdl-tsc pipeline \ --wsdl-source https://example.com/weather?wsdl \ --client-dir ./generated/weather/client \ --openapi-file ./generated/weather/openapi.json \ --gateway-dir ./generated/weather/gateway \ --gateway-service-name weather \ --gateway-version-prefix v1 # Service 2: Inventory npx wsdl-tsc pipeline \ --wsdl-source https://example.com/inventory?wsdl \ --client-dir ./generated/inventory/client \ --openapi-file ./generated/inventory/openapi.json \ --gateway-dir ./generated/inventory/gateway \ --gateway-service-name inventory \ --gateway-version-prefix v1 ``` -------------------------------- ### applyShapeCatalogs Example Source: https://github.com/techspokes/typescript-wsdl-client/blob/main/docs/api-reference.md Example of resolving companion catalogs against a compiled catalog. ```typescript import { applyShapeCatalogs, loadStreamConfigFile, } from "@techspokes/typescript-wsdl-client"; import path from "node:path"; const streamConfig = loadStreamConfigFile("./stream.config.json"); await applyShapeCatalogs(compiled, streamConfig, { baseDir: path.dirname(path.resolve("./stream.config.json")), }); ``` -------------------------------- ### CI/CD Multi-Stage Build - Client Generation Source: https://github.com/techspokes/typescript-wsdl-client/blob/main/docs/cli-reference.md Generates a client from a catalog file. ```bash npx wsdl-tsc client \ --catalog-file ./build/service-catalog.json \ --client-dir ./src/services/service ``` -------------------------------- ### parseStreamConfig Example Source: https://github.com/techspokes/typescript-wsdl-client/blob/main/docs/api-reference.md Example of parsing a stream configuration from an in-memory value. ```typescript import { parseStreamConfig } from "@techspokes/typescript-wsdl-client"; const streamConfig = parseStreamConfig({ operations: { MyStreamOp: { recordType: "MyRecordType", recordPath: ["MyStreamOpResponse", "Records", "Record"], }, } }); ``` -------------------------------- ### Commit Message Examples Source: https://github.com/techspokes/typescript-wsdl-client/blob/main/CONTRIBUTING.md Examples of commit messages. ```text - Version: 0.5.1 fix(parser): handle empty choice elements - Version: 0.5.1 docs: add complex inheritance example - Version: 0.5.1 feat(cli): add --attribute-prefix flag ``` -------------------------------- ### Run All Stages at Once Source: https://github.com/techspokes/typescript-wsdl-client/blob/main/docs/migration-playbook.md Or run all stages at once with the `pipeline` command and `--init-app`. ```bash npx wsdl-tsc pipeline \ --wsdl-source https://your-service.example.com/service.svc?wsdl \ --client-dir ./generated/client \ --openapi-file ./generated/openapi.json \ --gateway-dir ./generated/gateway \ --gateway-service-name your-service \ --gateway-version-prefix v1 \ --init-app ``` -------------------------------- ### Recommended Build Script Source: https://github.com/techspokes/typescript-wsdl-client/blob/main/docs/production.md A recommended npm script configuration for generating code, building the project, and type checking. ```json { "scripts": { "generate": "npx wsdl-tsc pipeline --wsdl-source ./wsdl/service.wsdl --client-dir ./src/client --openapi-file ./docs/api.json --gateway-dir ./src/gateway --gateway-service-name svc --gateway-version-prefix v1", "build": "npm run generate && tsc", "typecheck": "tsc --noEmit" } } ``` -------------------------------- ### Generate a typed SOAP client Source: https://github.com/techspokes/typescript-wsdl-client/blob/main/docs/start-here.md Run the `client` command. This generates TypeScript interfaces for all WSDL types and a typed client class with one method per SOAP operation. ```bash npx wsdl-tsc client \ --wsdl-source your-service.wsdl \ --client-dir ./generated/client ``` -------------------------------- ### Generate an OpenAPI spec from a WSDL Source: https://github.com/techspokes/typescript-wsdl-client/blob/main/docs/start-here.md Run the `openapi` command. This generates an OpenAPI 3.1 specification with schemas derived from the same type system used for the TypeScript client. ```bash npx wsdl-tsc openapi \ --wsdl-source your-service.wsdl \ --openapi-file ./generated/openapi.json ``` -------------------------------- ### StreamConfigError Handling Example Source: https://github.com/techspokes/typescript-wsdl-client/blob/main/docs/api-reference.md Example of handling StreamConfigError when loading or parsing stream configurations. ```typescript import { StreamConfigError } from "@techspokes/typescript-wsdl-client"; try { loadStreamConfigFile("./stream.config.json"); } catch (err) { if (err instanceof StreamConfigError) { console.error(err.toUserMessage()); process.exit(1); } throw err; } ``` -------------------------------- ### Verify Installation Source: https://github.com/techspokes/typescript-wsdl-client/blob/main/docs/troubleshooting.md Check if the wsdl-tsc CLI is installed and accessible, and run a smoke test pipeline. ```bash npx wsdl-tsc --help npm run smoke:pipeline ``` -------------------------------- ### Generate the client from a WSDL source Source: https://github.com/techspokes/typescript-wsdl-client/blob/main/examples/typescript-project/README.md This command generates the SOAP client from a WSDL source using npx wsdl-tsc. ```bash npx wsdl-tsc pipeline \ --wsdl-source https://example.com/service?wsdl \ --client-dir ./generated/client ``` -------------------------------- ### Running Tests Source: https://github.com/techspokes/typescript-wsdl-client/blob/main/docs/testing.md Commands to run different sets of Vitest tests and the full CI pipeline. ```bash npm test # All Vitest tests npm run test:unit # Unit tests only npm run test:snap # Snapshot tests only npm run test:integration # Integration tests only npm run test:watch # Watch mode for development For the full CI pipeline including smoke tests: npm run ci ``` -------------------------------- ### Type Safety Example Source: https://github.com/techspokes/typescript-wsdl-client/blob/main/docs/generated-code.md Example showing type safety with generated types for SOAP operations. ```typescript const result: GetCityWeatherByZIPResponse = await client.GetCityWeatherByZIP({ ZIP: "10001" }); result.GetCityWeatherByZIPResult.Temperature; ```