---
title: "Work with SOAP and XML APIs"
slug: "work-with-soap-and-xml-apis"
updated: 2023-02-21T18:41:09Z
published: 2023-02-21T18:41:09Z
canonical: "support.tulip.co/work-with-soap-and-xml-apis"
---
> ## Documentation Index
> Fetch the complete documentation index at: https://support.tulip.co/llms.txt
> Use this file to discover all available pages before exploring further.
# Work with SOAP and XML APIs
## Overview
*A guide with tips and tricks for working with XML-based APIs*
[Tulip Connectors](https://support.tulip.co/docs/an-overview-of-http-connectors) can be used to interact with many types of external data sources. This article focuses on HTTP APIs that exchange information using [XML](https://en.wikipedia.org/wiki/XML). This category includes [SOAP](https://en.wikipedia.org/wiki/SOAP) APIs.
## Sending XML Data in Tulip
To send XML content in the body of a request, use the `$value$` notation to show that a parameter should be inserted.
For example, with the following in the Request Body field:
```
$input1$
$input2$
```
and the values `input1` and `input2` as inputs to the Connector Function, a request is made with the values of `input1` and `input2` substituted into the Request Body.
This is shown in the Tulip Connector Function interface below:

## Parsing XML Data in Tulip
### A Simple API Example
Let's start with a simple example response from an XML API.
```
Everyday Italian
Giada De Laurentiis
2005
30.00
Harry Potter
J K. Rowling
2005
29.99
Learning XML
Erik T. Ray
2003
39.95
```
The following examples show how to access the various pieces of information within Tulip.
An extractor of:
```
/bookstore/book[1]/title
```
returns:
```
Everyday Italian
```
Note that arrays in XML are "1-indexed", meaning that the first element is in the "1" position, as opposed to JSON-query which is "0-indexed".
An extractor of:
```
/bookstore/book[1]/title/text()
```
returns:
```
Everyday Italian
```
Note that the `/text()` function is used to extract the text value contained within the selected node.
An extractor of:
```
/bookstore/book[@category="children"][1]/title/text()
```
returns:
```
Harry Potter
```
Note that the selector has allowed us to search within the properties of a node.
These examples can be directly used in Tulip as shown below:

### A SOAP API Example
Now let's examine a more complex case with namespaces, a typical feature of SOAP APIs.
```
0
info retrieved successfully
My Operation
None
1234567-890
B
PartNumber
1234567-890
PartRevision
B
PartDescription
My example part
Normal
```
This response uses XML Namespaces, which add complexity. For most cases, a global search using the `//*` and `.//*` operators makes extraction very simple.
An extractor of:
```
//*[local-name()="propertyName"][1]/text()
```
returns:
```
PartNumber
```
Note that arrays in XML are "1-indexed", meaning that the first element is in the "1" position, as opposed to json-query which is "0-indexed".
An extractor of:
```
//*[local-name()="Property"]
```
returns:
```
PartNumber
1234567-890
PartRevision
B
PartDescription
My example part
```
Note here that the namespaces are "brought down" into this result. And therefore a sub-query would still search the global namespace.
To extract an Array of Objects, use the global search shown in the previous example to extract the array, and then a local search extractor of:
```
.//*[local-name()="propertyName"]/text()
```
to retrieve an array of objects of the form:
```
[
{
"Name": "PartNumber"
"Value": "1234567-890"
},
{
"Name": "PartRevision"
"Value": "B"
},
{
"Name": "PartDescription"
"Value": "My example part"
}
]
```
These examples are shown in the Tulip Connectors Interface below:

---
Did you find what you were looking for?
You can also head to [community.tulip.co](https://community.tulip.co/?utm_source=intercom&utm_medium=article-link&utm_campaign=all) to post your question or see if others have faced a similar question!
**Connector Function**
**Connector Functions** are individual operations to interact with an HTTP or SQL Datasources. Connector Functions can have inputs and outputs, and can be called from: Triggers, Functions, Automations, and AI Agents.
Once pulled, data can be used throughout your applications.
**JSON**
**JSON (JavaScript Object Notation)** is a light-weight, text-based data format that is used to store and transfer data.
**Array**
**Arrays** are a Tulip Datatype. Arrays are a list of other variables. Every element in an array must be the same type.
Arrays are very useful when managing multiple values that represent the same information.
*ex. The measurements of 10 quality checks can be stored in an Array of Numbers, as opposed to 10 Number variables.*
**Object**
**Objects** are a Tulip Datatype. Objects represent an arbitrary grouping of attributes. Leveraging objects can simplify the process of working with complex data architectures. Often **Connector** **Functions** will return **Arrays** of **Objects**
*ex. My car object has 5 attributes, Color, Make, Model, # of wheels, # of seats.*
**Connectors**
**Connectors** enable real-time connectivity between your Tulip solution and a transactional system (e.g. an ERP). The output of a Connector Function can be used in Tulip Apps, Automations, and Functions.
- **HTTP Connectors** utilize HTTP API endpoints.
- **SQL Connectors** can enable connectivity with certain SQL databases.
- **MQTT Connectors** can connect to MQTT brokers for machine monitoring.
