-
Socket Connection multiple ISYs
Ok, I just tried again now. Thanks!
-
Socket Connection multiple ISYs
@bmercier done, thank you!
-
Socket Connection multiple ISYs
Thanks @bmercier, looks like it results in the same, a 500 error. I must be missing something else pretty basic. I'll have to keep tweaking things. Just to double check, you mention above... This means that I shouldn't need to include "/isy/ISYKEY" in the url right? Thanks again!
-
Socket Connection multiple ISYs
Hey @bmercier and @Javi thank you both for the help! It looks like a simple post to the wsdl returns a 500 error when trying to use the portal with the full url to the isy: const postBody = ` <s:Envelope> <s:Body> <u:Subscribe xmlns="urn:udicom:service:X_Insteon_Lighting_Service:1"> <reportURL>REUSE_SOCKET</reportURL> <duration>Infinite</duration> </u:Subscribe> </s:Body> </s:Envelope>`; let headers = new HttpHeaders(); headers = headers.append('Authorization', 'Basic ' + btoa(`myportalemail@email.com:myportalpassword`)); headers = headers.append('Content-type', 'text/xml'); headers = headers.append('SOAPACTION', '"urn:udi-com:service:X_Insteon_Lighting_Service:1#Subscribe"'); this.http.post('https://my.isy.io/isy/ISYKEYHERE/services.wsdl', postBody, { headers: headers, responseType: 'text'}).subscribe(res => { console.log('Component - res:', res); }); Returns: ERROR HttpErrorResponse {headers: HttpHeaders, status: 500, statusText: "Internal Server Error", url: "https://my.isy.io/isy/ISYKEY/services.wsdl", ok: false, …} headers: HttpHeaders {normalizedNames: Map(0), lazyUpdate: null, lazyInit: ƒ} status: 500 statusText: "Internal Server Error" url: "https://my.isy.io/isy/ISYKEY/services.wsdl" ok: false name: "HttpErrorResponse" message: "Http failure response for https://my.isy.io/isy/ISYKEY/services.wsdl: 500 Internal Server Error" error: "Internal Server Error" This works locally so I'm sure I'm missing something very basic. Also, It looks like as mentioned above that you shouldn't need to include the url to the ISY when using the portal because the default behavior is to use the preferred isy, is this true? Thanks so much!
-
Socket Connection multiple ISYs
Hey @bmercier I too am trying to subscribe to my ISY through the portal via SOAP. I can get the SOAP subscription working locally no problem with the following: var auth = 'Basic ' + new Buffer('isyUserName:isyPassword').toString('base64'); var body = '<s:Envelope><s:Body>\ <u:Subscribe xmlns:u="urn:udicom:service:X_Insteon_Lighting_Service:1">\ <reportURL>REUSE_SOCKET</reportURL><duration>infinite</duration></u:Subscribe>\ </s:Body></s:Envelope>'; isyClient.write('POST /services HTTP/1.1\r\n'); isyClient.write('Host: 192.168.1.23:80\r\n'); isyClient.write('Authorization: ' + auth + '\r\n'); isyClient.write('SOAPACTION: urn:udi-com:service:X_Insteon_Lighting_Service:1#Subscribe\r\n'); isyClient.write('Content-Length: ' + body.length + '\r\n'); isyClient.write('Content-Type: text/xml; charset="utf-8"\r\n\r\n'); isyClient.write(body); isyClient.write('\r\n'); But when I try to connect through the portal without the ISY code as you mention I get an error 401 ok. Here's what my code looks like when doing so: var auth = 'Basic ' + new Buffer('myPortalEmail@email.com:myPortalPassword').toString('base64'); var body = '<s:Envelope><s:Body>\ <u:Subscribe xmlns:u="urn:udicom:service:X_Insteon_Lighting_Service:1">\ <reportURL>REUSE_SOCKET</reportURL><duration>infinite</duration></u:Subscribe>\ </s:Body></s:Envelope>'; isyClient.write('POST /services HTTP/1.1\r\n'); isyClient.write('Host: https://my.isy.io:443\r\n'); isyClient.write('Authorization: ' + auth + '\r\n'); isyClient.write('SOAPACTION: urn:udi-com:service:X_Insteon_Lighting_Service:1#Subscribe\r\n'); isyClient.write('Content-Length: ' + body.length + '\r\n'); isyClient.write('Content-Type: text/xml; charset="utf-8"\r\n\r\n'); isyClient.write(body); isyClient.write('\r\n'); I'm sure my credentials are correct, do you happen to see anything that may be causing this issue? Thanks!
briantreese
Members
-
Joined
-
Last visited