Skip to content

Implement request #61105: Support Soap 1.2 SoapFault Reason Text lang attribute #18701

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nielsdos
Copy link
Member

This is on the border line of a bugfix and a new feature. Anyway, this is necessary to fix compatibility with .NET clients.

… attribute

This is on the border line of a bugfix and a new feature.
Anyway, this is necessary to fix compatibility with .NET clients.
ZVAL_EMPTY_STRING(Z_FAULT_STRING_P(obj));
ZVAL_NULL(Z_FAULT_CODE_P(obj));
ZVAL_NULL(Z_FAULT_CODENS_P(obj));
ZVAL_NULL(Z_FAULT_ACTOR_P(obj));
ZVAL_NULL(Z_FAULT_DETAIL_P(obj));
ZVAL_NULL(Z_FAULT_NAME_P(obj));
ZVAL_NULL(Z_FAULT_HEADERFAULT_P(obj));
ZVAL_NULL(Z_FAULT_LANG_P(obj));
Copy link
Member

Choose a reason for hiding this comment

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

Should this maybe be:

Suggested change
ZVAL_NULL(Z_FAULT_LANG_P(obj));
ZVAL_EMPTY_STRING(Z_FAULT_LANG_P(obj));

?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm uncertain. The other things are nullable too. The language attribute is actually only applicable if the client requested SOAP 1.2, it's unimportant in SOAP 1.1. I suppose this should be changed to an empty string for simplicity but I'd have to think a bit.

Comment on lines +1257 to +1260
add_soap_fault_ex(&exception_object, this_ptr, "Server", ZSTR_VAL(msg), NULL, NULL, SOAP_GLOBAL(lang_en));
zend_string_release_ex(msg, 0);
} else {
add_soap_fault_ex(&exception_object, this_ptr, "Server", "Internal Error", NULL, NULL);
add_soap_fault_ex(&exception_object, this_ptr, "Server", "Internal Error", NULL, NULL, SOAP_GLOBAL(lang_en));
Copy link
Member

@Girgias Girgias May 29, 2025

Choose a reason for hiding this comment

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

Maybe having two new add_soap_fault_en{_ex}() APIs is better than passing that global into every call?
Similar to what you did with soap_server_fault_en()

@bukka
Copy link
Member

bukka commented May 31, 2025

The logic seems reasonable from really quick look and with my limited knowledge of SOAP. :)

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.

3 participants