Magento – how to get magento2 wsdl XML structure

apimagento2magento2-dev-betawsdlxml

In magento1 for any request API, WSDL XML structure can be obtained by giving URL http://192.168.0.183/magento1131/api/v2_soap/?wsdl=1 in SOAPUI, storm or any other wsdl xml request processor.

For the same in magento2, to get the WSDL XML structure for any API request if i type the URL http://192.168.0.183/NewMagento2/soap?wsdl&services=customerCustomerRepositoryV1 ,its giving error.

In magento1 we can get WSDL XML structure like below

enter image description here

but getting below error in magento2

enter image description here

So please let me know how to get magento2 XML structure for any API request

Best Answer

in magento2, the API endpoints are protected. So to download the wsdl, you need authentication.

I know (or maybe I did not find it) that SoapUI for example does not support authenticating for WSDL's.

So I downloaded the WSDL through some other client which can send the authentication header and then added it to SOAP UI from the local downloaded WSDL file.

You need to create a new Integration in the Magento Backend (system -> integrations) and then use the access token in your auth header:

Header: Authorization: Bearer [access_token]

(http://devdocs.magento.com/guides/v2.0/get-started/authentication/gs-authentication-token.html)