Import node errors as "Invalid Child Type"
Here is the WSDL I am attempting to use: https://gist.github.com/iDVB/8a518b829a79aad4d3b2
node-soap throws the wsdl.js - Line 319 "Invalid Child Type" error and when I debug I can see that its the...
<wsdl:import location="/WEB/udiws30.ws" namespace="http://www.universal-devices.com/wsdk/isy/3.0"/>
...node that is the issue. Any suggestions on how to handle this?
Does node-soap not handle wsdl:import ?
Yes, it appears that node-soap does not yet handle the full wsdl spec. So far I have noticed the following missing: wsdl:documentation wsdl:import
Please feel free to correct me if this is not right.
Is there anyone maintaining this repo that might be able to offer a reply?
I may be shooting in the dark here, but in general the location and namespace are supposed to be full URIs which means you need to specify the full path (something like <wsdl:import location=" http://www.universal-devices.com/wsdk/isy/3.0/WEB/udiws30.ws" namespace=" http://www.universal-devices.com/wsdk/isy/3.0"/> )
/******************/ Adam McCormick
#!/usr/bin/perl split("","106117115116032097110111116104101114032080101114108032104097099107101114044"); while (scalar @) { print chr(join("",splice(@,0,3))); }
On Tue, Sep 10, 2013 at 11:34 AM, iDVB [email protected] wrote:
Is there anyone maintaining this repo that might be able to offer a reply?
— Reply to this email directly or view it on GitHubhttps://github.com/milewise/node-soap/issues/165#issuecomment-24179577 .
Hey alanbly, Thanks for the reply. Yes, that would make sense to me as well. However, this issue is higher up. It appears node-soap does not even handle nodes that are of the element type "documentation" or "import". This would need a change to the wsdl.js in order to define what those nodes mean and how to parse them.
That makes sense. The best idea would be to fork the repo, put in a fix, and send a pull request. There are a couple of us that can merge fixes in, but it's not any of our main focuses
/******************/ Adam McCormick
#!/usr/bin/perl split("","106117115116032097110111116104101114032080101114108032104097099107101114044"); while (scalar @) { print chr(join("",splice(@,0,3))); }
On Tue, Sep 10, 2013 at 1:04 PM, iDVB [email protected] wrote:
Hey alanbly, Thanks for the reply. Yes, that would make sense to me as well. However, this issue is higher up. It appears node-soap does not even handle nodes that are of the element type "documentation" or "import". This would need a change to the wsdl.js in order to define what those nodes mean and how to parse them.
[image: wsdl.js from node-soap]https://github-camo.global.ssl.fastly.net/de5edf4dc01bbf2b186820d8a434baff528aa078/687474703a2f2f676f6f2e676c2f6f485174664e
— Reply to this email directly or view it on GitHubhttps://github.com/milewise/node-soap/issues/165#issuecomment-24185868 .
Ok ... well ...it appears I made a few false assumptions which I've now found more info on so let me share.
Originally, my WSDL was crapping out in the wsdl.js parser of node-soap at the first occurrence of a node of type wsdl:import and wsdl:documentation.
I falsely assumed this to be missing support for import and documentation which would likely have been a rather large gap. However, I later found that xsd:import and xsd:documentation IS supported.
I'm still newb and guessing here, but I think this is likely only missing a very small part of the wsdl spec in this way.
Ex: I have a known valid wsdl at /services.wsdl
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:u="http://www.universal-devices.com/wsdk/isy/3.0" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="udi" targetNamespace="http://www.universal-devices.com/wsdk/isy/3.0">
<wsdl:documentation>
Copyright 2007/2012 Universal Devices, Inc.
All Rights Reserved
Web Services Flag, Objects, Parameters, Messages, and Bindings for ISY
WebService Port/Binding for ISY
</wsdl:documentation>
<wsdl:import
namespace="http://www.universal-devices.com/wsdk/isy/3.0"
location="udiws30.wsdl">
</wsdl:import>
<wsdl:service name="UDIServices">
<wsdl:port name="UDIServices_Port" binding="u:UDIServices_Binding">
<wsdl:documentation>UDIServices defines the Port to which all UDI Services should be POSTED</wsdl:documentation>
<soap:address location="http://isy/services" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Notice the wsdl:import to another wsdl. This is the only piece that seems to break. I managed to get a working client out of my wsdl by manually cutting the wsdl:service node out of services.wsdl and pasting it at the bottom of udiws30.wsdl and then simply pointing the soap.createClient()'s url to that. This way... the only imports are of type xsd:import.
I then manually set the ws endpoint when calling soap.createClient():
var soap = require('soap')
, url = './WSDL_edits/udiws30.wsdl'
;
soap.createClient(url, function(err, client) {
client.GetISYConfig({}, function(err, result){
console.log(result);
});
}, 'http://192.168.1.200/services');
Btw, I'm so hoping someone with more WSDL experience jumps in here and tells me all the things I'm doing wrong. :)
I have the same problem with wsdl:import
I closed this issue as there was no activity for nearly a year now - also a bunch of new versions of the library were released which may now fix this issue (especially this issue should be fixed from v0.4.5 onwards).
If this issue still exists and you want to get it solved, feel free to reopen.