Skip to content

feat(Server): method called with apply#1115

Closed
bruno-brant wants to merge 1 commit intovpulim:masterfrom
bruno-brant:feature/add-support-for-this
Closed

feat(Server): method called with apply#1115
bruno-brant wants to merge 1 commit intovpulim:masterfrom
bruno-brant:feature/add-support-for-this

Conversation

@bruno-brant
Copy link
Copy Markdown
Contributor

When using node-soap to create a soap server, one could prefer to declare and instantiate a class and pass that as the service object (although the current documentation does instruct developers to use anonymous objects). This would allow us to create more complex service implementations by using methods, properties, etc.

However, right now, doing so results in little gain since methods are being called directly, without correctly setting the "this" variable.

The correction is very simple, though: the owning object for method is port; it's just a question of instead of invoking it directly, just call apply and pass the port as it's this variable.

@coveralls
Copy link
Copy Markdown

coveralls commented Jun 21, 2020

Coverage Status

Coverage increased (+0.002%) to 94.857% when pulling 15542fd on bruno-brant:feature/add-support-for-this into 699b984 on vpulim:master.

…being called directly, which enables access to "this".The owning object for the method is the port, therefore, that's what is being passed as "this".
Comment thread package-lock.json
{
"name": "soap",
"version": "0.29.0",
"version": "0.31.0",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please revert this. maintainers will bump

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@w666 -- it appears that you guys already have the tests covering this due to the nature of the change? The only thing holding this up was that premature version bump; once removed, this should OK, no?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added to my backlog. Will look a bit later this or next week.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

erm, can't easily check these changes, @bruno-brant has deleted forked repo. Will return to this later when have time.

@w666 w666 self-requested a review March 25, 2025 07:59
smokhov pushed a commit to smokhov/node-soap that referenced this pull request Jul 27, 2025
Method is "applied" instead of being called directly, which enables access to "this".
The owning object for the method is the port, therefore, that's what is being passed as "this".

Author:    Bruno Brant <1890900+bruno-brant@users.noreply.github.com>
@w666 w666 closed this in #1315 Aug 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants