-
Notifications
You must be signed in to change notification settings - Fork 17
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
Null reference error #3
Comments
Hi @RoarkDude, |
Hi,
My credentials are ok. I know because they work when using Postman |
@RoarkDude yes, your credentials can be ok, but you don't pass them to the function. I mean you use incorrect arguments. but insteadof "User", "Password" you use "" and "": |
Right, I don't want to use soap, I want to use rest. I tried putting "n/a" for soap user and password but still same error. Maybe you can document an an example using
Thanks. |
@RoarkDude in general 4 keys from magento store : accessToken, accessTokenSecret, consumerSecret, consumerKey doesn't make sense, because you can always accesss your store API just with store simple user credentials. At this moment only this way supported, later i will added support for these 4 keys. So, to start working, you should create user (system->all users), add correct permissons for that user. Use your user credentials as i wrote above: "User" = your store user It doesn't metter do you use REST or SOAP, you should always use your user credentials like in example above. @RoarkDude also don't forget to Init service after creation. Does it work for you now? |
Init service? That's not in the documentation at all. I added it and I'm still getting same errors with
I tried both admin user and password and a user I created with and admin role and password. |
@RoarkDude can ypu add complete description of these "some" errors that you receive? |
Here's the code:
Here's the error. I think "Store":null is the is the null reference that's causing the exception: `
` Stack Trace: |
@RoarkDude Unfortunately, i have no time to fix it right now. If you will create a fix for |
Hi I have tried DetermineMagentoVersionAndSetupServiceAsync , GetOrdersAsync with and without dates but nothing seems to work.. Would be nice if you can update this.. This could be quite a useful library. |
@ashishsuvarna, DetermineMagentoVersionAndSetupServiceAsync , GetOrdersAsync work, i tested it on dozens of production stores via SOAP (and magentoAccess work with dozens of production stores at this moment). I think your problem related to incorrect parameters. Look to the Tests there are a lot of examples there. @ashishsuvarna Also, can you provide your code which causes that exception? |
Hey, I hope it will help you to find the issue, and maybe solve it for this version too :). |
Hi,
Creating a service requires additional parameters not specified in the documentation. I guessed and used:
Also, left Soap parameters as empty strings.
Should return the 2 orders in the test webstore. The API call works using Postman with the same credentials. This throws and exception (same for GetProductsAsync()):
System.AggregateException occurred
HResult=0x80131500
Message=One or more errors occurred.
Source=mscorlib
StackTrace:
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task
1.GetResultCore(Boolean waitCompletionNotification) at System.Threading.Tasks.Task
1.get_Result()at MagentoClient.Program.Main(String[] args) in C:\Users\Peter\magentoAccess-master\src\MagentoClient\Program.cs:line 29
Inner Exception 1:
MagentoCommonException: GetOrdersAsync:{MethodName:GetOrdersAsync, ConnectionInfo:{"StoreVersion":"2.0.2.0","ApiUser":"","ApiKey":"","Store":null,"BaseMagentoUrl":"http://localhost/Magento","TokenSecret":null,"LogRawMessages":true,"GetStockItemsWithoutSkuImplementedWithPages":true,"GetOrderByIdForFullInformation":true,"GetOrdersUsesEntityInsteadOfIncrementId":true}, MethodParameters:, Mark:"826af4bc-2bd5-4998-9404-4fb5e35e7af4", {}}
Inner Exception 2:
NullReferenceException: Object reference not set to an instance of an object.
The text was updated successfully, but these errors were encountered: