Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug #45282: SoapClient has namespace issues when WSDL is distributed #15842

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

nielsdos
Copy link
Member

@nielsdos nielsdos commented Sep 11, 2024

Fixes one of the oldest highest voted SOAP bugs: https://bugs.php.net/bug.php?id=45282

We're ignoring the namespaces that the messages, ports, bindings and
services are defined in when registering them. Consequently, we're also
ignoring the namespace component of the QName when looking up
references.

This patch solves this issue by introducing a new qname_hash_table type
along with two methods to add and query the table. Internally, it's a
nested HashTable where the outer layer is the namespace uri and the
inner layer is the local name.

It's worth pointing out that at least one comment in the original issue
points to a WSDL that actually has a validation issue because it has two
messages with the same local name in the same namespace, so in that case
PHP's SOAP client is actually correct. The other links in the comments
no longer exist, but I was able to reconstruct the issue based on
reading the report and by cross-checking the expected behaviour with the
WSDL spec.

@nielsdos nielsdos force-pushed the soap-45282 branch 8 times, most recently from 57a39c1 to 2b5e021 Compare September 13, 2024 19:23
@nielsdos nielsdos marked this pull request as ready for review March 15, 2025 13:16
By having a newline in there, we get whitespace in the namespace uri,
which is incorrect.
targetNamespace and tns do not match, which means that the lookup for
the messages in tns should fail. However, due to a bug this currently
doesn't fail. This will fail in the future after a bugfix.
We're ignoring the namespaces that the messages, ports, bindings and
services are defined in when registering them. Consequently, we're also
ignoring the namespace component of the QName when looking up
references.

This patch solves this issue by introducing a new qname_hash_table type
along with two methods to add and query the table. Internally, it's a
nested HashTable where the outer layer is the namespace uri and the
inner layer is the local name.

It's worth pointing out that at least one comment in the original issue
points to a WSDL that actually has a validation issue because it has two
messages with the same local name in the same namespace, so in that case
PHP's SOAP client is actually correct. The other links in the comments
no longer exist, but I was able to reconstruct the issue based on
reading the report and by cross-checking the expected behaviour with the
WSDL spec.
@nielsdos nielsdos marked this pull request as draft March 15, 2025 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant