Last active
December 23, 2016 21:45
-
-
Save redgeoff/8a877b931857bc62c4e8690e64b4c1bf to your computer and use it in GitHub Desktop.
GoExpo SOAP To RESTful API Example
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
| <html> | |
| <head> | |
| <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script> | |
| </head> | |
| <body> | |
| <script> | |
| var username = 'TODO'; | |
| var password = 'TODO'; | |
| var url = 'INSERT-PATH-HERE/soapToRestful.php'; | |
| var addOrEditExhibitor = function (exhibitor) { | |
| return jQuery.post(url, JSON.stringify({ | |
| method: 'addOrEditExhibitor', | |
| data: { | |
| ge_username: username, | |
| ge_password: password, | |
| exhibitor: exhibitor | |
| } | |
| })); | |
| }; | |
| var getExhibitor = function (extId) { | |
| return jQuery.get(url, { | |
| method: 'getExhibitor', | |
| data: { | |
| ge_username: username, | |
| ge_password: password, | |
| ext_id: extId | |
| } | |
| }); | |
| }; | |
| addOrEditExhibitor({ | |
| company_name: 'Google', | |
| ext_id: 'GOOGLE' | |
| }).then(function (response) { | |
| console.log('addOrEditExhibitor response=', response); | |
| return getExhibitor('GOOGLE'); | |
| }).then(function (exhibitor) { | |
| console.log('exhibitor=', exhibitor); | |
| }); | |
| </script> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment