magentoapi | Magento SOAP API Wrapper | SOAP library
kandi X-RAY | magentoapi Summary
kandi X-RAY | magentoapi Summary
Magento SOAP API Wrapper
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of magentoapi
magentoapi Key Features
magentoapi Examples and Code Snippets
Community Discussions
Trending Discussions on magentoapi
QUESTION
I am using https://www.npmjs.com/package/magento-api-xmlrpc library in a NodeJS project (running inside Docker) to connect to Magento v1.x via XML-RPC.
I've tested it locally on my windows like this:
...ANSWER
Answered 2017-Aug-29 at 12:20Sorry, this is not a bug!
It turns out that we had IP white listing on the site I was testing with and after allowing the public IP of the docker container on the magento dev site, it started to work.
False alarm...
QUESTION
The short story is - I need a way for a single code base to be able to connect to multiple SOAP APIs where each API's WSDL is essentially the same except that the XML Namespace varies site by site.
The long story is (sorry there is a lot of this):
My .NET 4.5 application acts as a client to the Magento SOAP API (downloads orders, uploads products, stock levels etc). The application uses a Service Reference to a stock Magento WSDL, and for Magento 1.x this worked fine - the application could connect to any website's Magento API just by passing a different endpoint URL when instantiating the client.
So then Magento 2 came along, and I wanted to make a new version of the application that could interface with it. However a significant challenge arose.
I started by creating a Service Reference to a known Magento 2 website API's WSDL (this was not straightforward as under Magento 2 the WSDL is only exposed if the request is OAUTH authenticated, but that is another story). The application worked fine when connecting to that same website API. However when any other endpoint URL is used to instantiate the client, every method call seems to result in a null response object. If the Service Reference is re-created from the target website's WSDL, then it starts working. Obviously I cannot do this and compile a new version of the application for every different possible target website!
I looked at the difference between my reference WSDL and another, and traced the request and response with Fiddler, and I noticed something that I believe to be the root cause of the problem. Unlike under Magento 1.x, a Magento 2 WSDL has XML Namespaces specific to the website the WSDL came from. This translates to different Namespace values in class attributes in the Reference.cs of the Service Reference, for example:
Magento 1.x attributes (note the generic Namespace value):
...ANSWER
Answered 2017-Feb-15 at 18:37I got it working by changing the AfterReceiveReply method. For some reason, using an XmlDocument to help create the modified reply works.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install magentoapi
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page