I'm currently working on a side project using python and NetSuite Webservices. I've been able to send off a request for data centers successfully. I'm using the element tree import to parse the xml requests and responses. No matter what I try to grab one of the urls below I end up getting no value and I'm assuming this has to do with name spacing which i'm terrible with.
<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header>
<platformMsgs:documentInfo xmlns:platformMsgs="u:messages_2016_1.platform.webservices.netsuite.com">
<platformMsgs:nsId>WEBSERVICES__XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</platformMsgs:nsId>
</platformMsgs:documentInfo>
</soapenv:Header>
<soapenv:Body>
<getDataCenterUrlsResponse xmlns="">
<platformCore:getDataCenterUrlsResult xmlns:platformCore="u:core_2016_1.platform.webservices.netsuite.com">
<platformCore:status isSuccess="true" />
<platformCore:dataCenterUrls>
<platformCore:restDomain>https://rest.na1.netsuite.com</platformCore:restDomain>
<platformCore:webservicesDomain>https://webservices.na1.netsuite.com</platformCore:webservicesDomain>
<platformCore:systemDomain>https://system.na1.netsuite.com</platformCore:systemDomain>
</platformCore:dataCenterUrls>
</platformCore:getDataCenterUrlsResult>
</getDataCenterUrlsResponse>
</soapenv:Body>
</soapenv:Envelope>
import xml.etree.ElementTree as ET
ns = {'platformCore': 'u:messages_2016_1.platform.webservices.netsuite.com'}
xml.find('platformCore:webservicesDomain', ns)
the xml.find() never retus anything but null values regardless of selector or namespacing. If someone could relay to me what the correct way was so I could get this url and other data from these responses I'd appreciate it.
If you are wondering why I'm doing things the hard way instead of using a client or a better tool. I'm trying to embed some webservice functionality inside of sublime text 3 which uses a specific version of python 3 (3.3.6) and makes importing libraries not impossible but a hassle.
