OpenMage / magento-lts

Official OpenMage LTS codebase | Migrate easily from Magento Community Edition in minutes! Download the source code for free or contribute to OpenMage LTS | Security vulnerability patches, bug fixes, performance improvements and more.
https://www.openmage.org
Open Software License 3.0
863 stars 438 forks source link

SOAP API: SOAP-ERROR: Parsing Schema: unexpected <complextype> in schema #3973

Closed sermage9 closed 1 month ago

sermage9 commented 2 months ago

Preconditions (*)

  1. OpenMage 20.6.0 and OpenMage 19.4.23
  2. Fresh OM installs, no migrations from M1.

Steps to reproduce (*)

  1. Make a Soap call (both v1 and v2): $url: https://example.com/api/v2_soap?wsdl=1; $client->login($user, $password);
  2. Or calling dumbly: https://example.com/api/soap/

Expected result (*)

  1. Successful soap login or "access denied"
  2. Invalid XML error

Actual result (*)

  1. SOAP-ERROR: Parsing Schema: unexpected \<complextype> in schema
  2. And in nginx error log: SOAP-ERROR: Parsing Schema: unexpected \<complextype> in schema in /vendor/shardj/zf1-future/library/Zend/Soap/Server.php on line 814

Already checked:

  1. curl, libxml are installed
  2. can curl the wsdl and get the XML back.
  3. can curl from the same server.
empiricompany commented 1 month ago

I've checked on latest 20.7.0 and it works for me.

$client = new SoapClient('https://example.com/api/v2_soap?wsdl=1');
$session = $client->login($username, $password);
echo $session;

Do you have any active extensions? They can cause issues if they alter the output invalidating the XML (even just by inserting a space).

Have you checked if the problem was caused by this issue https://github.com/OpenMage/magento-lts/issues/3968 and if it's resolved now?

fballiano commented 1 month ago

can't reproduce, also you can see WSDL works also on the demo https://demo.openmage.org/api/v2_soap?wsdl=1

sermage9 commented 1 month ago

I'll do a comparison from a fresh install on same servers and the two instances disabling all third-party modules and let you know ASAP. If a third-party module turns out to be the culprit, it's good to know!

sermage9 commented 1 month ago

Works as expected on OM 20.7 fresh install. I'll narrow down on what module can cause this. If you want, you can close this request. Thanks.