diff --git a/Readme.md b/Readme.md index 02527ad03..f97a600e7 100644 --- a/Readme.md +++ b/Readme.md @@ -160,8 +160,8 @@ Construct a `Promise` with the given WSDL file. // async/await var client = await soap.createClientAsync(url); - var result = await client.MyFunctionAsync(args); - console.log(await result); + var { result } = await client.MyFunctionAsync(args); + 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. diff --git a/src/client.ts b/src/client.ts index 2996d9ef9..9a414f355 100644 --- a/src/client.ts +++ b/src/client.ts @@ -236,7 +236,7 @@ export class Client extends EventEmitter { if (err) { reject(err); } else { - resolve([result, rawResponse, soapHeader, rawRequest, mtomAttachments]); + resolve({result, rawResponse, soapHeader, rawRequest, mtomAttachments}); } }; method(