Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.6.1 "Object #<Object> has no method 'indexOf'" #533

Closed
yicone opened this issue Jan 3, 2015 · 2 comments
Closed

0.6.1 "Object #<Object> has no method 'indexOf'" #533

yicone opened this issue Jan 3, 2015 · 2 comments

Comments

@yicone
Copy link

yicone commented Jan 3, 2015

In my case, there are an array arg in soap request, I received this error.

After review node-soap source code(0.6.1), I'm not sure there are a bug (in wsdl.js:1431):

     if(parentNamespace) 

I debug it for a long time, found the array element's "parentNamespace" is ''(empty), so that 'namespace' is continue to be a Object, that why I received the error of "Object # has no method 'indexOf'"(throw by line 1463).

So I guess there should be:

    if(parentNamespace || parentNamespace === '')

Relatedly, when I change it as above, I received another error: "Unmarshalling Error: Undeclared namespace prefix 'xs'".

Then I found the line 1469(still in wsdl.js):

    correctOuterNamespace = parentNamespace || ns; //using the parent namespace if given

Because parentNamespace may make sense when it equals '' , so I changed the line:

    correctOuterNamespace = (parentNamespace === '' ? '' : (parentNamespace || ns));

That works for me, but I'm not sure if I do a correct fix! So I hope that I can get some help.

yicone added a commit to yicone/node-soap that referenced this issue Jan 4, 2015
@herom
Copy link
Contributor

herom commented Jan 5, 2015

@yicone thanks for reaching out and debugging the code down to the problem, this is much appreciated 👍

Given your description, this seems like a legit and valuable fix to the problem, so I'm happy if you can provide your code as a Pull Request 😃

Please, don't forget to add at least one test (request-response-sample preferred) and run npm test at your local machine before you reach in the PR. I'd also suggest you read our Guideline for submitting a Pull Request as this would make the process much easier and faster 👍

@MageCoder
Copy link

We have the same issue, we cannot pass an array in the soap request args input. The 2 amendments described here fix this for us. It would be much appreciated to have this included in the next release version.
(Fix described in #536 does not work for us.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants