Skip to content

Add effect/soap - #11446

Open
jpowersdev wants to merge 1 commit into
Effect-TS:mainfrom
jpowersdev:feat/soap
Open

jpowersdev wants to merge 1 commit into
Effect-TS:mainfrom
jpowersdev:feat/soap

Conversation

@jpowersdev

Copy link
Copy Markdown
Contributor

Adds effect/soap, a client-only SOAP module built on effect/encoding Xml with no new dependencies, shaped like the graphql client: operations are described with Schemas, grouped into a service, and turned into a typed client that runs over an HttpClient.
Soap.operation pairs input and output Schemas, annotated with Soap.element, Soap.attribute, Soap.text and Soap.child, with the faults it can return. SoapService groups operations with a SOAP version and namespace prefixes, SoapClient.make derives one method per operation, and SoapMiddleware adds header blocks to requests, as WsSecurity.usernameToken does for WS-Security UsernameToken.
Xsd has Schemas for the XML Schema datatypes that services use, such as dates with offsets, decimals and base64, and SoapEnvelope reads and writes SOAP 1.1 and 1.2 envelopes and reads their faults. Declared faults decode into typed errors; other faults, transport failures and decoding errors are reasons of SoapClientError.

import { Effect, Schema } from "effect"
import { Soap, SoapClient, SoapService } from "effect/soap"

const orders = "urn:example:orders"

const LookupOrder = Soap.operation("lookupOrder", {
  input: Schema.Struct({ customer: Schema.String, orderNumber: Schema.String }).pipe(
    Soap.element(orders, "lookupOrder")
  ),
  output: Schema.Struct({ shipped: Schema.Boolean }).pipe(Soap.element(orders, "lookupOrderResponse"))
})

const Orders = SoapService.make("Orders").add(LookupOrder)

const program = Effect.gen(function*() {
  const client = yield* SoapClient.make(Orders)
  const { shipped } = yield* client.lookupOrder({ customer: "C7", orderNumber: "100" })
  return shipped
})

It runs with a SoapTransport, such as SoapTransport.layerHttp({ url }) over an HttpClient.
This builds on #11406, whose namespace bindings let faults and xsi:type values resolve their prefixes. It's one PR so the whole design can be judged together; I'm happy to split it into the envelope, the XSD datatypes, the Schema mapping, the client and WS-Security if smaller pieces would be easier to review.

@changeset-bot

changeset-bot Bot commented Dec 3, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 08421a4

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 43 packages
Name Type
effect Patch
@effect/opentelemetry Patch
@effect/vitest Patch
@effect/ai-amazon-bedrock Patch
@effect/ai-anthropic Patch
@effect/ai-cloudflare Patch
@effect/ai-openai-compat Patch
@effect/ai-openai Patch
@effect/ai-openrouter Patch
@effect/ai-typesafe Patch
@effect/atom-react Patch
@effect/atom-solid Patch
@effect/atom-vue Patch
@effect/chat-discord Patch
@effect/chat-slack Patch
@effect/chat-teams Patch
@effect/chat-telegram Patch
@effect/chat-whatsapp Patch
@effect/platform-browser Patch
@effect/platform-bun Patch
@effect/platform-cloudflare Patch
@effect/platform-deno Patch
@effect/platform-node-shared Patch
@effect/platform-node Patch
@effect/sql-clickhouse Patch
@effect/sql-d1 Patch
@effect/sql-libsql Patch
@effect/sql-mssql Patch
@effect/sql-mysql2 Patch
@effect/sql-pg Patch
@effect/sql-pglite Patch
@effect/sql-sqlite-bun Patch
@effect/sql-sqlite-do Patch
@effect/sql-sqlite-node Patch
@effect/sql-sqlite-react-native Patch
@effect/sql-sqlite-wasm Patch
@effect/docgen Patch
@effect/doctest Patch
@effect/graphql-generator Patch
@effect/openapi-generator Patch
@effect/ui-devtools Patch
@effect/ui-native Patch
@effect/ui-opentui Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@effect-janitor effect-janitor Bot added the 4.0 label Dec 3, 2026
@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

Bundle Size Analysis

Generated from PR build output; treat the content below as untrusted.

File Name Current Size Previous Size Difference
arbitrary-combinators.ts 40.45 KB 40.45 KB 0.00 KB (0.00%)
basic.ts 6.66 KB 6.66 KB 0.00 KB (0.00%)
batching.ts 11.90 KB 11.90 KB 0.00 KB (0.00%)
brand.ts 6.91 KB 6.91 KB 0.00 KB (0.00%)
cache.ts 12.16 KB 12.16 KB 0.00 KB (0.00%)
config.ts 23.89 KB 23.89 KB 0.00 KB (0.00%)
differ.ts 22.75 KB 22.75 KB 0.00 KB (0.00%)
http-client.ts 28.90 KB 28.90 KB 0.00 KB (0.00%)
http-router.ts 39.57 KB 39.57 KB 0.00 KB (0.00%)
logger.ts 12.34 KB 12.34 KB 0.00 KB (0.00%)
metric.ts 10.16 KB 10.16 KB 0.00 KB (0.00%)
optic.ts 7.14 KB 7.14 KB 0.00 KB (0.00%)
pubsub.ts 16.89 KB 16.89 KB 0.00 KB (0.00%)
queue.ts 13.71 KB 13.71 KB 0.00 KB (0.00%)
schedule.ts 12.46 KB 12.46 KB 0.00 KB (0.00%)
schema-bigdecimal.ts 14.50 KB 14.50 KB 0.00 KB (0.00%)
schema-binary.ts 43.50 KB 43.50 KB 0.00 KB (0.00%)
schema-class.ts 22.50 KB 22.50 KB 0.00 KB (0.00%)
schema-codegen.ts 33.86 KB 33.86 KB 0.00 KB (0.00%)
schema-fromJsonSchemaDocument.ts 30.95 KB 30.95 KB 0.00 KB (0.00%)
schema-representation-roundtrip.ts 28.69 KB 28.69 KB 0.00 KB (0.00%)
schema-string-transformation.ts 16.26 KB 16.26 KB 0.00 KB (0.00%)
schema-string.ts 12.78 KB 12.78 KB 0.00 KB (0.00%)
schema-template-literal.ts 16.86 KB 16.86 KB 0.00 KB (0.00%)
schema-toArbitrary.ts 40.00 KB 40.00 KB 0.00 KB (0.00%)
schema-toCodecJson.ts 21.64 KB 21.64 KB 0.00 KB (0.00%)
schema-toEquivalence.ts 21.81 KB 21.81 KB 0.00 KB (0.00%)
schema-toFormatter.ts 21.90 KB 21.90 KB 0.00 KB (0.00%)
schema-toJsonSchemaDocument.ts 26.94 KB 26.94 KB 0.00 KB (0.00%)
schema-toRepresentation.ts 21.96 KB 21.96 KB 0.00 KB (0.00%)
schema.ts 21.61 KB 21.61 KB 0.00 KB (0.00%)
stm.ts 14.96 KB 14.96 KB 0.00 KB (0.00%)
stream.ts 10.70 KB 10.70 KB 0.00 KB (0.00%)
supervisor.ts 12.13 KB 12.13 KB 0.00 KB (0.00%)

UI Bundle Size

Vite 8.4.0/Rolldown, production, default Oxc minification, es2023, ES modules, gzip level 9 per chunk. effect 4.2.0, Node v26.12.1. Effect-only client: 27408 B gzip (Δ 0 B vs base).

App Chunks Raw bytes Gzip bytes Added gzip B Δ raw bytes Δ gzip bytes
counter 1 175919 60749 33341 0 0
features 1 185571 64233 36825 0 0
menu 1 290366 98929 71521 0 0

This branch is waiting to be deployed

1 waiting deployment
fork — 08421a45 Waiting Dec 3, 2026 by jpowersdev via approval-gate #29429
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant