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

TypeError: Cannot read property 'xsd:element' of undefined #7

Closed
blairanderson opened this issue Aug 13, 2014 · 1 comment
Closed

Comments

@blairanderson
Copy link

WSDL => https://webservice.s7.exacttarget.com/etframework.wsdl

$ wsdl2.js etarget etframework.wsdl

/Users/blairanderson/.nvm/v0.10.29/lib/node_modules/wsdl2.js/wsdl2.js:271
    var elements = thisSchema[ns['xsd']+'element'];
                             ^
TypeError: Cannot read property 'xsd:element' of undefined
    at /Users/blairanderson/.nvm/v0.10.29/lib/node_modules/wsdl2.js/wsdl2.js:271:30
    at Array.forEach (native)
    at processTypes (/Users/blairanderson/.nvm/v0.10.29/lib/node_modules/wsdl2.js/wsdl2.js:268:14)
    at processWSDL (/Users/blairanderson/.nvm/v0.10.29/lib/node_modules/wsdl2.js/wsdl2.js:67:3)
    at Object.<anonymous> (/Users/blairanderson/.nvm/v0.10.29/lib/node_modules/wsdl2.js/wsdl2.js:52:1)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
@hxoliverrumbelow
Copy link

It's an issue with your WSDL file having incorrect namespaces. Here's a snippet from the top:

<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://exacttarget.com/wsdl/partnerAPI" targetNamespace="http://exacttarget.com/wsdl/partnerAPI">
  <types>
    <schema xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://exacttarget.com/wsdl/partnerAPI" version="1.0">
      <import id="APIFault" schemaLocation="https://webservice.exacttarget.com/ETFrameworkFault.xsd" namespace="urn:fault.partner.exacttarget.com"/>
      <complexType name="APIObject">
        <sequence>
          <element name="Client" type="tns:ClientID" minOccurs="0" maxOccurs="1"/>
          <element name="PartnerKey" type="xsd:string" nillable="true" minOccurs="0" maxOccurs="1"/>
          <element name="PartnerProperties" type="tns:APIProperty" minOccurs="0" maxOccurs="unbounded"/>
...

Those element tags should be a part of the xsd namespace, at the top you've defined the default namespace to be wsdl.

This is your definition of the xsd namespace: xmlns:xsd="http://www.w3.org/2001/XMLSchema" (line #1)

Which means your <element tags need to be prefixed with the correct namespace like this <xsd:element as will any other XML tags you've used which are a part of xsd.

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

No branches or pull requests

2 participants