# SOAP

Returns a fluent SOAP client for making SOAP web service requests.

This BIF creates a new or retrieves an existing BoxSoapClient instance based on the provided WSDL URL. The client can be used to fluently invoke SOAP operations discovered from the WSDL. The client provides fluent methods for configuring connection settings like setTimeout(), setAuthentication(), and addHeader().

Example usage:

```
 // Create a SOAP client from WSDL
 ws = soap( "http://example.com/service.wsdl" )

 // Invoke a SOAP operation: methodName, passing arguments as an array
 result = ws.invoke( "methodName", [ arg1, arg2 ] )

 // With authentication and timeout configuration
 ws = soap( "http://example.com/service.wsdl" )
     .setTimeout( 60 )
     .setAuthentication( "user", "pass" )

 result = ws.invoke( "methodName", [ arg1, arg2 ] )
 
```

## Method Signature

```
SOAP(URL=[string])
```

### Arguments

| Argument | Type     | Required | Description                                             | Default |
| -------- | -------- | -------- | ------------------------------------------------------- | ------- |
| `URL`    | `string` | `true`   | The URL to the WSDL document describing the web service |         |

## Examples

## Related

* [HTTP](/boxlang-language/reference/built-in-functions/net/http.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/net/soap.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
