# Expose a transformation or job as a web service

You can run a PDI transformation or job as part of a web-service by developing one of the following implementations:

* Write a servlet that maps incoming parameters for a [transformation step](https://github.com/pentaho/documentation/blob/main/PDIA/10.3/Administer/Embed%20and%20extend%20Pentaho%20functionality/Embed%20and%20extend%20Pentaho%20functionality%20\(cp\)/Embed%20and%20extend%20PDI%20functionality/Embed%20Pentaho%20Data%20Integration/Sample%20Class%20Scenarios%20-%20Embed%20PDI/Run%20transformations=GUID-0D76C880-CB9F-4955-83E1-49C37BDF20E7=1=en=.md) or [job entry](https://docs.pentaho.com/pdia-admin/embed-and-extend-pentaho-functionality-cp/embed-and-extend-pdi-functionality/embed-pentaho-data-integration/broken-reference) and executes them as part of the request cycle.
* Use the Carte server or the Pentaho Server directly by building a transformation that writes its output to the HTTP response of the Carte server. Then, specify the **Pass Output to Servlet** option in the Text Output, XML Output, JSON Output, or scripting steps to write output to the HTTP response. For an example, run the `pentaho/design-tools/data-integration/samples/transformations/Servlet Data Example.ktr` sample transformation on Carte.
