doedje / jquery.soap

This script uses $.ajax to send a SOAP:Envelope. It can take XML DOM, XML string or JSON as input and the response can be returned as either XML DOM, XML string or JSON too.
352 stars 148 forks source link

cannot get v1.6.8 from npm #98

Closed divinocodino closed 8 years ago

divinocodino commented 8 years ago

Hi,

I am trying to get v1.6.8 through npm install but it does not refer to in valid targets ? i can only get v1.6.7 through npm install

doedje commented 8 years ago

Since $.soap was nog working with node.js I stopped pushing new versions to npm. With your changes in place I will indeed make sure the latest version is available from npm in the future.

divinocodino commented 8 years ago

i am using a local copy of jquery.soap v1.6.8 but npm update replaces it with 1.6.7

with jquery.soap v1.6.8 node import command work


import $ from 'jquery'
import $soap from 'jquery.soap'

do you still want me to review some more changes for v1.6.9?

doedje commented 8 years ago

I am trying to get things to work with nodejs version:

node --version
v0.12.7

and a test.js like this:

import $ from 'jquery';
import $soap from 'jquery.soap';

$.soap({
    url: 'http://localhost/jquery.soap/web/xml/fake-soap-response.xml'
});

but I get this error??

(function (exports, require, module, __filename, __dirname) { import $ from 'j
                                                              ^^^^^^
SyntaxError: Unexpected reserved word
    at exports.runInThisContext (vm.js:73:16)
    at Module._compile (module.js:443:25)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.Module.runMain (module.js:501:10)
    at startup (node.js:129:16)
    at node.js:814:3

As I said before, I am not used to working with nodejs, so maybe making a really simple n00b mistake. If you can set me up with a working example, that would be of great help! ;)

divinocodino commented 8 years ago

I am not in front of my dev machine, I can fix you a working example in the morning

soap call should be with $soap

$soap({
    url: 'http://localhost/jquery.soap/web/xml/fake-soap-response.xml'
});
divinocodino commented 8 years ago

Import is ES6 and is not supported by node v0.12.7 instead of


import $ from 'jquery';
import $soap from 'jquery.soap';

something like this should work

var $ = require('jquery');
var $soap = require('jquery.soap');

$soap({
    url: 'http://localhost/jquery.soap/web/xml/fake-soap-response.xml'
});

or

var $ = require('jquery');
require('jquery.soap');

$.soap({
    url: 'http://localhost/jquery.soap/web/xml/fake-soap-response.xml'
});
divinocodino commented 8 years ago

Hi doedje,

i have a working example for you, as i need jquery.soap in a react app, example is a react app with webpack https://github.com/arcseldon/react-babel-webpack-starter-app

if you download and install the app you should have a working example of a react app

2 more steps , install jquery.soap npm install jquery.soap upgrade jquery.soap module to 1.6.8

and replace attache file in the project , this gives you working example of jquery.soap in a react app when adding a new author

looking forward to get v1.6.8 from npm api.zip

doedje commented 8 years ago

thnx a lot, I will test it!

doedje commented 8 years ago

I got it to work with the 1.6.8 version, thanx for your example. It really helped me. Although I wonder why you made the changes to the script you described in #88 and in your fork. Because I didn't need any of these in the react app...

I was able to do the call with:

// import $ from 'jquery'; not needed in this example, jquery.soap has it as a dependency
import $soap from 'jquery.soap';

$soap({ ... });

and

import $ from 'jquery';
require('jquery.soap');

$.soap({ .... });

So I like the first example better.

Anywayz: 1.6.9 is avaiable from npm

divinocodino commented 8 years ago

That's great doedje, ignore my fork i did my changes based on assumption i am working off 1.6.7 once i did the fork i realise the latest is 1.6.8 not 1.6.7