XML Configuration Mode: Decoupling Your API Catalog from Business Code
Annotation mode keeps requests close to Java, but large integrations raise a fair question: do I want a wall of curl strings inside my service interfaces? JQuickCurl's XML mode answers with a firm no — you store every API definition in a separate XML file, and the business layer only sees plain Java interfaces with no annotations at all. This is the classic "declarative client" split: contract in…
XML Configuration Mode offers a way to separate the API catalog from business code, eliminating the need for annotations in Java code. This approach provides a declarative client split, where contract resides in configuration files while behavior stays in code. The process involves creating an XML API catalog with the official DTD, binding it to a plain Java interface, and using context variables in XML.
The XML file names each request and declares its return type, and a factory binds those entries to interface methods by method name. Changing the curl in XML results in a change in the running app behavior, without any Java edits or rebuilds. This approach is particularly useful when API surface is wide and changes often.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.