-
Notifications
You must be signed in to change notification settings - Fork 402
fix: correct WSDL URL construction in ilSoapClient for ILIAS 10 #11214
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
sKarki999
wants to merge
1
commit into
ILIAS-eLearning:release_10
Choose a base branch
from
sKarki999:fix/release_10_42320
base: release_10
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+28
−3
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Saghun,
this seems to work, but isn't it sufficient to do this instead?
My local installation is running on
http://localhost.php8-3/ilias/10xand it works fine. Can you provide any$_SERVER['SCRIPT_FILENAME']or value returned by the$request_path = ilUtil::_getHttpPath()call which does not work with my snipped above?Best regards,
Michael
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @mjansenDatabay ,
With only those changes i am receving this in the log:
[935cf] [2026-03-02 11:19:23.091395] atlas10_wsrv.WARNING: ilSoapUtils::callNextNode:178 Soap init failed with message: SOAP-ERROR: Parsing WSDL: Couldn't load from 'http:/soap/server.php?wsdl' : failed to load external entity "http:/soap/server.php?wsdl".
The path is not formed correctly in my system. So instead of dirname, I parsed the URL to reconstruct the base URL and appending /soap/server.php?wsdl, and it works.
Additionally my local instance is simply: "http://localhost" so value returned by $request_path = ilUtil::_getHttpPath() is 'http://localhost'.
For example:
For something like this:
dirname("http://localhost", 1) => it returns "http:". The host is getting stripped, producing "http:/soap/server.php?wsdl"
Am i missing something here? Please let me know, what do you think? :)
kind regards,
Sagun
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Sagun,
thanks for the feedback.
What I do not understand: In case the HTTP client requests
http://localhost/ilias.php,ilUtil::_getHttpPath()seems to returnhttp://localhostin your case,$_SERVER['SCRIPT_FILENAME']should then point to something like this: `/var/www/your_ilias_root/public/ilias.php.In case the HTTP client requests
http://localhost/soap/server.php.ilUtil::_getHttpPath()should returnhttp://localhost/soapand$_SERVER['SCRIPT_FILENAME']should point to something like this:/var/www/your_ilias_root/public/soap/server.php.In both cases, the code snippet above should work.
Best regards,
Michael
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @mjansenDatabay ,
With only those changes in my system i receive following.
I have added few logs and triggered the copy process.
In the logs i can see such statements.
DEBUG _getHttpPath() returns: http://localhost
DEBUG ILIAS_HTTP_PATH constant: http://localhost
DEBUG ILIAS_MODULE: components/ILIAS/soap
DEBUG SCRIPT_FILENAME: .../public/soap/server.php
And:
DEBUG request_path: http://localhost <--- before dirname($request_path, 1)
DEBUG SCRIPT_FILENAME: .../public/soap/server.php
DEBUG request_path: http: <--- after dirname($request_path, 1)
DEBUG SCRIPT_FILENAME: .../public/soap/server.php
atlas10_wsrv.WARNING: Soap init failed with message: SOAP-ERROR: Parsing WSDL: Couldn't load from 'http:/soap/server.php wsdl' : failed to load external entity "http:/soap/server.php?wsdl"
Any clue why this is happening in my system or somewhere i can check for the settings which might be different than how you have in your system or in general.
Thanks in advance :)
kind regards,
Sagun
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah okay,
SCRIPT_FILENAMEmust be an absolute server path if executed in a "Web Context".Do you execute/test the snippet with PHP CLI (which actually cannot be the case, since there is a
PHP_SAPI !== 'cli'check)?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @mjansenDatabay
Till now, i executed in web context. I triggered the copy from the UI and hence the information in logs.
:)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm, maybe some misconfiguration? That's unexpected under normal PHP behavior and likely indicates a server configuration issue (e.g., FPM backend not setting expected vars) or the request being proxied incorrectly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi again @mjansenDatabay ,
Please correct me if i am wrong here.
I tested directly in HttpPathBuilder.
When I access http://localhost/soap/test.php, REQUEST_URI is /soap/test.php and _getHttpPath() returns http://localhost/soap. So the test script would work correctly with dirname.
However, one thing i noticed, the soap/server.php defines ILIAS_MODULE = 'components/ILIAS/soap'. When this constant is defined, HttpPathBuilder::build() strips the module depth from REQUEST_URI, so perhaps _getHttpPath() returns just http://localhost.
With that, dirname("http://localhost", 1) strips the host instead of a path segment, producing "http:".
Maybe this behaviour is due to the fact in the files test script and soap/server.php, only server.php defines ILIAS_MODULE. Could this be the case?
What should be done at this point as we are undecided only about one part? What do you recommend here?
Thank you :)
Sagun