Closed Aspro1 closed 5 years ago
As mentioned in the readme: https://github.com/doedje/jquery.soap/blob/master/README.md#dependencies
jQuery.soap is a jQuery plug-in and as such it needs jQuery. I admin the readme is not overly clear on this....
The “README.md” file mentions it generally, but I would have appreciated being able to save some time by finding more accurate information like this in the “README.md” file or in a reply to my issue:
––––– In a “*.js” file using React.js, add these imports at the beginning:
import 'jquery';
import 'jquery.soap';
Initialization lines need to be used prior to a “$.soap” call:
let $ = require('jquery');
require('jquery.soap');
$.soap({
…
});
–––––
Sorry Astro, there are numerous platforms and libraries and ways to use JavaScript and I really think it is way out of the scope of my readme to tell you how to include dependencies for every single one of them. I tell you the dependencies, you read the documentation of whatever platform or library your using to come up with the proper code to include them... that’s called self reliance and is as far as I’m concerned a obligatory skill for anyone that wants to be a coder.
I would like to call a SOAP webservice with React.js. I installed jquery.soap (version 1.7.3) with npm in the “node_modules” folder. I tried using this code in my “App.js” file:
` $.soap({ url: 'http://localhost:…/LoginService.asmx', // with a port number method: 'Login',
` I have this error message:
––––– Failed to compile ./src/App.js Line 43: '$' is not defined no-undef Line 61: 'soapResponse' is not defined no-undef
Search for the keywords to learn more about each error. This error occurred during the build time and cannot be dismissed. –––––
What is wrong? Do I need to add an import at the beginning of my “App.js” file? If so, I cannot find out what the import must look like. The “README.md” file does not say anything about it.