1

I need to develop an application driver that connect a CMS with Magento 2.0, using the SOAP API. My application is a Java J2SE and so I choose the axis2 project. I generate the code using the wsdl2Java tool and I'm able to create account using CustomerAccountManagementV1CreateAccountRequest command. Now I'm trying to get the customer repository using CustomerRepositoryV1GetListRequest, but I get the error message: "customer is not authorized to access %resources". I think I need to authenticate but I don't know how to do that. I hope someone could help, I do not have much time and I need a fast way to do that. Thanks

asked Dec 11, 2015 at 18:30
0

1 Answer 1

1

Yes, you are right, you need to send authentication header. How to authenticate for WebApi in Magento2 you can find here http://devdocs.magento.com/guides/v2.0/get-started/authentication/gs-authentication.html

answered Dec 11, 2015 at 20:29
2
  • thanks for your answer. I red the docs but I'm still confused: Mine is not a mobile apps and even a third party apps. In the first case auth token is used but they uses REST, I need SOAP! In the second OAuth but it looks like unnecessary and to complicated to me. Commented Dec 11, 2015 at 22:28
  • For development purposes you can create Bearer token using, for example, curl and REST curl -X POST "http://magentohost/index.php/rest/V1/integration/admin/token" -H "Content-Type:application/json" -d '{"username":"admin", "password":"password"}' As a result of this request you will get the Bearer token, e.g. "tGzv3JOkF0XG5Qx2TlKWIA" Then you should add this token to the authentication header in your SOAP request: "Authorization: Bearer tGzv3JOkF0XG5Qx2TlKWIA" Commented Dec 12, 2015 at 18:25

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.