8

I am creating a module that connects to a SOAP service, I have generated classes for this service using wsdl2phpgenerator which uses autoload.php. Placing this in "lib/" with the correct class namings makes it easy to include in Magento 1.9. How do I go about including these classes in Magento2?

1

This library should be shipped as a part of your custom module. Specify path to autoload.php of generated library in composer.json of your module. Should have something like this:

{
    ...
    "autoload": {
        "files": [
            "registration.php",
            "path-to-generated-soap-client-lib-autoload.php"
        ],
        ...
    }
}
| improve this answer | |
  • 1
    This probably works for modules installed through the marketplace but not for modules installed by extracting them manually. Better to require the autoloader from inside registration.php. – snez Jul 5 '16 at 22:47
  • 1
    is it possible to detail the full process please? – Alexglvr Apr 21 '17 at 11:03
  • @snez How to add that file into registration.php, Let me code for that. – Hitesh Vaghasiya Aug 25 '17 at 9:09
  • Can you please advise on this magento.stackexchange.com/questions/310486/… ? – Hamendra Sunthwal Apr 16 at 4:54
1

If this library use autoload.php, you should require this library via magento composer

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.