Created
December 17, 2015 15:20
-
-
Save ryaan-anthony/9d1d98fcf14078b77e96 to your computer and use it in GitHub Desktop.
Using CURL to make SOAP requests with Magento 1.x
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cat login.xml | |
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> | |
<SOAP-ENV:Body> | |
<MAGE:login xmlns:MAGE="http://xxxxxx/api/v2_soap/?wsdl=1"> | |
<MAGE:username>xxxxxx</MAGE:username> | |
<MAGE:apiKey>xxxxxx</MAGE:apiKey> | |
</MAGE:login> | |
</SOAP-ENV:Body> | |
</SOAP-ENV:Envelope> | |
$ curl --data @login.xml http://xxxxxx/api/v2_soap | |
<?xml version="1.0" encoding="UTF-8"?> | |
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:Magento" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> | |
<SOAP-ENV:Body> | |
<ns1:loginResponse> | |
<loginReturn xsi:type="xsd:string">xxxxxx</loginReturn> | |
</ns1:loginResponse> | |
</SOAP-ENV:Body> | |
</SOAP-ENV:Envelope> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use the session id provided in loginReturn to formulate your requests.