Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't connect to store #5

Open
ghost opened this issue Jul 23, 2017 · 1 comment
Open

Can't connect to store #5

ghost opened this issue Jul 23, 2017 · 1 comment

Comments

@ghost
Copy link

ghost commented Jul 23, 2017

Hi,

I'm new, don't know what i do wrong.
I've been working on it for a couple of days and drives me crazy ;-)
I use Magento ver. 2.1.5
i have create a roll "Web service role" an give him all the rights on the api settings.
Create a user "syncuser" assign to the roll "Web service role". I also create a intergration and have the consumeKey, consumerSecret, accessToken and the accessTokenSecret.
I have installed soap en see a response if i goto http://magentotestserver.com:81/soap?wsdl_list

I use the following code

        private void ConnectToMangeto()
        {
            int productThreadsLimit = 4;
            int sessionLifeTimeMs = 180000;
            bool isLogRawMessages = false;
            string storeURL = "http://magentotestserver.com:81";
            string soapUser = "syncuser";
            string soapPassword = "*******";
            string consumeKey = "**********t136p24enb9";
            string consumerSecret = "**********6k8hyc8pdovlps";
            string accessToken = "**********2ku5ifulyu6c4";
            string accessTokenSecret = "**********u3ybtxx766we";

            var servicesFactory = new MagentoFactory();
            var magentoService = servicesFactory.CreateService(new MagentoAuthenticatedUserCredentials(
                "n/a",
                "n/a",
                storeURL,
                "n/a",
                "n/a",
                soapUser,
                soapPassword,
                productThreadsLimit,
                sessionLifeTimeMs,
                isLogRawMessages),
                new MagentoConfig()
                {
                    EditionByDefault = "ce",
                    VersionByDefault = "2.0.0.0",
                    Protocol = MagentoDefaultProtocol.RestOnly
                });

            bool isInitialized = magentoService.InitAsync().Result;

            if (isInitialized)
            {
                var margento = magentoService.DetermineMagentoVersionAndSetupServiceAsync().Result;
            }

I run the code "MagentoDefaultProtocol.RestOnly" get back
magento.edtion = "CE"
magento.SoapWorks = true
magento.Version = "R2.0.0.0"

I run the code "MagentoDefaultProtocol.SoapOnly" get back
everhting is empty
magento.edtion = ""
magento.SoapWorks = false
magento.Version = ""

If i will connect with "MagentoDefaultProtocol.RestOnly" and get all the products "var magento = magentoService.GetProductsAsync().Result;" i get the following inner expetion
"webexception the remote server returned an error (404) not found"

If i will connect with "MagentoDefaultProtocol.SoapOnly" and get all the products "var magento = magentoService.GetProductsAsync().Result;" i get the following inner expetion
"Unbound prefix used in qualified name 'rpc:ProcedureNotPresent'."

Can somebody ponit me to the right direction?

Thanx Patrick.

@MaximKitsenko
Copy link
Contributor

@aenv

  1. I suggest you to try user name and user password instead of consumer keys.
  2. Look into tests, there are a lot of real examples which can point you what fields to use.
  3. REST support will be added next days
  4. Your link doesn't work
  5. "I have installed soap en " what does it mean? All tests provided here, works with default SOAP

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant