Skip to content

Commit

Permalink
Client.*method*Async can have options as the second argument (#1104)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevemao committed Feb 10, 2020
1 parent 8390ab9 commit c484871
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion Readme.md
Expand Up @@ -514,7 +514,7 @@ Interesting properties might be:
* `forceMTOM`: set to True if you want to send the request as MTOM even if you don't have attachments


### Client.*method*Async(args) - call *method* on the SOAP service.
### Client.*method*Async(args, options) - call *method* on the SOAP service.

``` javascript
client.MyFunctionAsync({name: 'value'}).then((result) => {
Expand All @@ -528,6 +528,23 @@ Interesting properties might be:

The `args` argument allows you to supply arguments that generate an XML document inside of the SOAP Body section.

The `options` object is optional and is passed to the `request`-module.
Interesting properties might be:
* `timeout`: Timeout in milliseconds
* `forever`: Enables keep-alive connections and pools them
* `attachments`: array of attachment objects. This converts the request into MTOM: _headers['Content-Type']='multipart/related; type="application/xop+xml"; start= ... '_
```
[{
mimetype: content mimetype,
contentId: part id,
name: file name,
body: binary data
},
...
]
```
* `forceMTOM`: set to True if you want to send the request as MTOM even if you don't have attachments

##### Example with JSON for the `args`
The example above uses `{name: 'value'}` as the args. This may generate a SOAP messages such as:

Expand Down

0 comments on commit c484871

Please sign in to comment.