Skip to main content

How to implement Plugin concept in magento2

I want to implement plugin after, before and around concept in my Magento 2 website.

di.xml :

<type name="Magento\Webapi\Model\Soap\Server">
    <plugin name="soap_log" type="training\learning\Model\Webapi\Soap\Server" />
</type>

Magento\Webapi\Model\Soap\Server has a method _checkRequest and it has a string type parameter.

Now i want to get that string type parameter in my _aftercheckrRequest in training\learning\Model\Webapi\Soap\Server class. How can I achieve this ?

prasad maganti
  • 912
  • 2
  • 18
  • 36