I am creating a new module to shipping methods in Magento 2.

I create a model where appends the methods but I need run a web service soap client. I add the row: $soapClient = new Zend\Soap\Client(NULL,'http://www.example.com/oi/x/st/?wsdl'); but when run the code show an error but not have message:

enter image description here

If I not put the line it works correctly. I know this is the error.

Error in console:

enter image description here

The error I think is because the line $soapClient = new Zend\Soap\Client(NULL,'http://www.example.com/oi/x/st/?wsdl'); not work and the code not continue and not append methods. If I commment this line not show errors the console

Use this:

try {
     $soapClient = new Zend\Soap\Client(NULL,'http://www.example.com/oi/x/st/?wsdl');
} catch (Exception $e) {
     $writer = new \Zend\Log\Writer\Stream(BP . '/var/log/module1.log');
     $logger = new \Zend\Log\Logger();

In file module1.log not show anything.

  • Copy error from browser console. – Sohel Rana Jan 30 '17 at 14:55
  • wrap in in a try-catch – Marius Jan 30 '17 at 15:01
  • Marius I edit the post. I use try catch but not show execptions – AndresF Jan 30 '17 at 15:09
  • Could you check console output using firebug+firefox? – Sohel Rana Jan 30 '17 at 15:31
  • I discover first error. I not put "\" in Zend\Soap\Client. But I have an error calling the method but show the error Internal Error. Details are available in Magento log file. Report ID: webapi-588f5f7fef1df. This error in log put unknown reason – AndresF Jan 30 '17 at 15:46

Your Answer

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

Browse other questions tagged or ask your own question.