dhleong / wemore

A more awesome library for Belkin WeMo interactions
37 stars 11 forks source link

XML Parse Error on Device Detection #18

Closed thomas-br closed 4 years ago

thomas-br commented 4 years ago

Hi,

I'm running into issues on device detection with Wemore running as a docker container in my Smarthome network with my Echo Dot 3rd Gen.

On device detection phase wemore is receiving the xml:

<?xml version="1.0" encoding="utf-8"?><s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:GetBinaryState xmlns:u="urn:Belkin:service:basicevent:1"><BinaryState>1</BinaryState></u:GetBinaryState></s:Body></s:Envelope>

which fails on parsing (https://github.com/dhleong/wemore/blob/master/lib/emulate.js#L323) due to the missing space between envelope/" and s:encodingStyle

Error: No whitespace between attributes
Line: 0
Column: 102
Char: s

Any idea?

Echo Dot version: 3389730436

dhleong commented 4 years ago

Thanks for the report. This gives some context to the error described here.

It looks like the XML parser is barfing on that malformed data the Echo is sending, but I think we can just disable strict parsing.

dhleong commented 4 years ago

Just published 0.6.2; please give it a shot and let me know if it works. I tested it briefly but I'm not at home and don't have my normal setup here.

thomas-br commented 4 years ago

works 👍