TypeError: Cannot set property 'targetNSAlias' of undefined
Hey Guys,
After finally getting expat compiled and installed on windows, i've tried loading a wsdl into node-soap to create a web service server.
Ive loaded into SoapUI tool to test wsdl/xsd compliance and sent test request/response ok.
when i start a simple node http server, i get the following:
C:\Documents and Settings\Administrator\My Documents\Web Service Current\node_modules\soap\lib\wsdl.js:346 this.element.targetNSAlias = ns; ^ TypeError: Cannot set property 'targetNSAlias' of undefined at [object Object].postProcess (C:\Documents and Settings\Administrator\My Documents\Web Service Current\node_modules\soap\lib\wsdl.js:346:36) at [object Object].postProcess (C:\Documents and Settings\Administrator\My Documents\Web Service Current\node_modules\soap\lib\wsdl.js:378:17) at [object Object].postProcess (C:\Documents and Settings\Administrator\My Documents\Web Service Current\node_modules\soap\lib\wsdl.js:395:15) at [object Object].postProcess (C:\Documents and Settings\Administrator\My Documents\Web Service Current\node_modules\soap\lib\wsdl.js:408:14) at [object Object].postProcess (C:\Documents and Settings\Administrator\My Documents\Web Service Current\node_modules\soap\lib\wsdl.js:440:21) at C:\Documents and Settings\Administrator\My Documents\Web Service Current\node_modules\soap\lib\wsdl.js:594:36 at C:\Documents and Settings\Administrator\My Documents\Web Service Current\node_modules\soap\lib\wsdl.js:641:13 at C:\Documents and Settings\Administrator\My Documents\Web Service Current\node_modules\soap\lib\wsdl.js:641:13 at [object Object]._processNextInclude (C:\Documents and Settings\Administrator\My Documents\Web Service Current\node_modules\soap\lib\wsdl.js:635:26) at [object Object].callback (C:\Documents and Settings\Administrator\My Documents\Web Service Current\node_modules\soap\lib\wsdl.js:640:14)
The WSDL being loaded is here: http://pastebin.com/iECgpUJs The first import schema which is loaded (aidx/IATA_AIDX_FlightLegNotifRQ.xsd) is here: http://pastebin.com/5V0r3eYM
Any help would be greatly appreciated!
Andrew
Was a NS issue, not sure if it was with node or the WSDL, but moving imported xsds into the wsdl was my workaround.
still reproducible without any import. wsdl http://pastebin.com/YCkPMBUB
Same problem here...
+1
I'm working on this one. The pastes have been removed from pastebin. What are the wsdl documents that I can use to reproduce your error?
Same issue. For me this dirty workarround solved it:
wsdl.js line 409 add
if (!this.element) return;
after
this.element = definitions.schemas[definitions.xmlns[ns]].elements[nsName.name];
WSDL i am working with is http://product-api.affili.net/Authentication/Logon.svc?wsdl
@sfakir See CONTRIBUTING.md. Can you issue a pull request with the fix, and a generic version of the WSDL under test/wsdl?
I'm seeing the exact same behavior with this WSDL. http://explorit-test.jonesegloballibrary.com/strata_egl-test/services/searchService.wsdl
It does use import and include, but they are in the same directories. Not sure if that is the problem.
I did use the if (!this.element) return; hack, but when I try to use the client, there are a number of undefined elements.
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:impl="http://deepwebtech.com/assistant/search/" xmlns:query="http://deepwebtech.com/assistant/query/" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"><soap:Header></soap:Header><soap:Body><searchRequest xmlns:undefined="undefined" xmlns="undefined"><synchronousResults></synchronousResults><query></query></searchRequest></soap:Body></soap:Envelope>
Still scratching my head on this one.
Having the same issue here. I'm no WSDL expert whatsoever, but what I've noticed is that the parsing breaks on the very first element; the element named IssueVAN.
The parser attempts to access the definition linked to the namespace tns, which is http://schemas.datacontract.org/2004/07/eNett.PublicServices.vNett.Host.ViewModels.v2 at the moment the error occurs. In the WSDL I see that tns gets defined in the root <wsdl:definitions> node, as well as in an <xs:schema> node.
Is this something you can work with? Again, I'm no WSDL expert, I might be completely wrong.
WSDL: http://pastebin.com/69vRaRNm
I don't have time to actually try to debug and see where it's going wrong right now, but could you try and change line 76 in lib/wsdl.js and see if parsing the WSDL works?
Change it from
if (obj.hasOwnProperty(key)) {
to
if (obj.hasOwnProperty(key) && !base[key]) {
Hi all.
I'm having the same problems as above, and I can confirm that the fix from @devotis works in my case. My WSDLs are generated by Asp.net WCF 4.0 and hosted on IIS7.
@Himanshu4, are you going to submit a pull request? It’d be nice to see some progress here. This is keeping me from upgrading my project to use io.js.
I have submitted a new pull request for the same issue.
Since @Himanshu4 s PR is merged in now, this should be solved.