Export a Service from Martini's HTTP Client
Overview
Martini's HTTP Client allows you to export any HTTP request as a reusable service, transforming standalone requests into integrated components. This feature enables you to invoke HTTP requests through triggers, use them as workflow nodes, or execute them within APIs, creating seamless integration between external services and your Martini applications.
What You Will Learn
- How to export both saved and unsaved HTTP requests as services
- Configure service parameters, headers, and authentication settings
- Generate data models automatically from HTTP responses
When To Use This
Use service export when you need to integrate external HTTP APIs into your Martini workflows or services. Common scenarios include:
- Creating reusable, automated HTTP integrations
- Orchestrating and composing external APIs into workflows and services
- Triggering integrations via events or schedules
Prerequisites
- Martini Designer installed and running
- A Martini Package in the active workspace
- Basic familiarity with creating HTTP requests in Martini
- At least one configured HTTP request (saved in Workspace/User Requests or unsaved but ready to use)
Exporting HTTP Requests as Services
Martini provides three convenient ways to export HTTP requests as services, accommodating different request states.
Getting Started with Service Export
Choose the method that matches your current HTTP request state:
For Saved HTTP Requests (Context Menu)
- Open the HTTP Client view
- Right-click on your saved HTTP request
- Hover over Export in the context menu
- Select Service from the submenu
For Unsaved HTTP Requests (Context Menu)
- Right-click on the HTTP request tab
- Select Export as Service from the context menu
For Any Opened HTTP Request (Toolbar Button)
- Open the HTTP request tab you want to export
- Click the Export as Service button in the tab toolbar
Expected result: The Service Export Wizard opens, ready to guide you through the configuration process.
Service Export Wizard Configuration
The Service Export Wizard guides you through six configuration steps to ensure your exported service matches your integration requirements.
Step 1: Service Location and Naming
- Location: Choose which Martini package and folder to save your service (click the Browse button to navigate)
- Name: Set the service name
Click Next when both fields contain valid values.
Step 2: Service Request Configuration
Configure the core HTTP service behavior:
- Service Name: Pre-filled but editable service identifier
- URL: The endpoint to consume (path parameters use {} format:
https://api.example.com/{userId}) - HTTP Method: Request method (
GET,POST,DELETE, etc.) - Response Content Type: Choose
Auto Detectto use server'sContent-Typeheader, or specify JSON/XML - Return Content As: Determines the data type of the response content. Select
Objectto enable an additional option for generating data models from the response.
Click Next when fields contain valid values.
Step 3: Parameter Configuration
Configure URL path and query parameters that become service inputs:
| Column | Purpose | Notes |
|---|---|---|
| Name | Parameter identifier | Multiple query parameters with same name become arrays |
| Default Value | Fallback when parameter not provided | Query parameters only |
| Array | Enable for multi-value query parameters | Allows multiple values in query string |
| Test Value | Value for response model generation | Not stored in final service |
Actions:
- Add button: Create a new parameter entry
- Delete button: Remove an existing parameter entry
Click Next when parameter configuration is ready.
Step 4: Header Configuration
Set up HTTP headers that the exported service will send:
| Column | Purpose |
|---|---|
| Name | Header name (e.g., Content-Type, Authorization) |
| Default Value | Default header value when not provided at runtime |
| Test Value | Value for testing and model generation only |
Actions:
- Add button: Create a new header
- Delete button: Remove an existing header
Click Next when header configuration is ready.
Step 5: Request Body Configuration
For HTTP methods that accept request bodies (POST, PUT, PATCH):
- Type: Select body format from dropdown (JSON, XML, Form Data, etc.)
- Content fields vary based on selected type
Note: This step is skipped for
GETrequests and other methods that don't accept bodies.
Click Next when request configuration is ready.
Step 6: Authentication Configuration
Configure the request's authentication method:
- Type: Select authentication method (No Auth, Basic Auth, OAuth, etc.)
- Additional fields appear based on the selected type
- Configure credentials or token handling as needed
- Store in Package Properties: Check this option to save credentials/tokens as package properties for secure, reusable credential management
- Package Property Prefix: Specify a prefix for the generated package properties (when Store in Package Properties is enabled)
Click Finish to generate the service.
How HTTP Service Export Works
The service export process transforms your HTTP request into a fully integrated Martini service through these steps:
- Configuration Capture: The Service Export Wizard collects all HTTP request details and service preferences
- Test Request Execution: Martini sends a test request using the provided test values
- Response Analysis: The system analyzes response structure and content type
- Data Model Generation: Creates input/output models based on request and response structure (only if configured to do so)
- Service Creation: Generates the service file with proper inputs, outputs, and HTTP client logic
- Integration Setup: The exported service becomes available for triggers, workflows, and API composition
HTTP Service Export Benefits and Use Cases
Exported HTTP services provide integration capabilities that streamline API consumption and workflow development:
Integration Benefits:
- Reusability: Convert one-time HTTP requests into repeatable service components
- Workflow Integration: Use external APIs as native workflow steps
- Type Safety: Generated data models provide structure and validation
- Consistency: Standardized service interface regardless of underlying API complexity
Real-World Applications:
- Data Synchronization: Export customer data retrieval APIs for scheduled sync workflows
- Payment Processing: Convert payment gateway calls into services for e-commerce workflows
- Notification Systems: Transform email/SMS API calls into workflow-triggered services
- External Validation: Convert third-party validation APIs into form processing services
Troubleshooting HTTP Service Export Issues
| Problem | Detection | Cause | Fix |
|---|---|---|---|
| Service generation warning | Warning message appears after clicking Finish | Test request failed during export | Check response code in warning, verify URL, parameters, and authentication |
| Missing data models | Generated service lacks input/output models | Test request returned non-standard response | Ensure test values produce valid response, check Response Content Type setting |
| Authentication errors | 401/403 errors during test request |
Invalid credentials or auth configuration | Verify authentication type and credentials |
| Parameter binding issues | Service inputs don't match expected values | Incorrect parameter configuration | Review parameter names and types, ensure path parameters match URL pattern |
| Response parsing failures | Service returns raw text instead of objects | Wrong content type detection | Manually specify JSON/XML instead of auto-detect |
Note: Even when warnings appear, the exported service is still generated. Review the warning message to identify configuration issues and adjust the service as needed.
Helpful Resources
- Basic Services - Understanding Martini service fundamentals
- Service Triggers - Automated service execution
- Workflow Service Nodes - Using services in workflows
- API Creation - Building APIs with exported services
- Data Models - Creating and managing structured data models for service inputs and outputs
- Community Q&A: Martini Community
Have a Question? Post or search it here.