From 145a01275fa9f9e8d86d9778aa7a3abc1acc1f62 Mon Sep 17 00:00:00 2001 From: Rodrigo Alcorta Date: Tue, 16 Jul 2024 04:49:17 -0300 Subject: [PATCH] Update Readme.md add example for xml string parameter (#1244) --- Readme.md | 47 +++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 45 insertions(+), 2 deletions(-) diff --git a/Readme.md b/Readme.md index 20066f05..912c5697 100644 --- a/Readme.md +++ b/Readme.md @@ -97,7 +97,7 @@ GitHub issues have been disabled to focus on pull requests. ([#731](https://gith ### soap.createClient(url[, options], callback) - create a new SOAP client from a WSDL url. Also supports a local filesystem path. -- `url` (*string*): A HTTP/HTTPS URL or a local filesystem path. +- `url` (*string*): A HTTP/HTTPS URL, XML or a local filesystem path. - `options` (*Object*): - `endpoint` (*string*): Override the host specified by the SOAP service in the WSDL file. - `envelopeKey` (*string*): Set a custom envelope key. (**Default:** `'soap'`) @@ -124,6 +124,7 @@ GitHub issues have been disabled to focus on pull requests. ([#731](https://gith #### Example +HTTP/HTTPS: ``` javascript var soap = require('soap'); var url = 'http://example.com/wsdl?wsdl'; @@ -136,13 +137,55 @@ GitHub issues have been disabled to focus on pull requests. ([#731](https://gith }); ``` +XML string format: +``` javascript + var soap = require('soap'); + var xml = ` + + + + + + + + + + + + + + + + + + + + + + + + + + + + `; + var args = {name: 'value'}; + + soap.createClient(xml, {}, function(err, client) { + client.MyFunction(args, function(err, result) { + console.log(result); + }); + }); +``` + + Note: for versions of node >0.10.X, you may need to specify `{connection: 'keep-alive'}` in SOAP headers to avoid truncation of longer chunked responses. ### soap.createClientAsync(url[, options]) - create a new SOAP client from a WSDL url. Also supports a local filesystem path. Construct a `Promise` with the given WSDL file. -- `url` (*string*): A HTTP/HTTPS URL or a local filesystem path. +- `url` (*string*): A HTTP/HTTPS URL, XML or a local filesystem path. - `options` (*Object*): See [soap.createClient(url[, options], callback)](#soapcreateclienturl-options-callback---create-a-new-soap-client-from-a-wsdl-url-also-supports-a-local-filesystem-path) for a description. - Returns: `Promise`