Hi all,
I'm new to this forum. So please be patient.
I'm creating some checks for an AVM Fritz!Box.
For some of them I have to deal with SOAP-XML.
This is a simplified check (at least the starting point):
Running in Postman it works as expected. Same with JS in ioBroker.
But in my Script-Item I alway get a '404 - NOT FOUND'.
For me it seems that there's a problem with POST on a HttpRequest.
GET (with of course a different endpoint) works fine.
Any suggestions?
Best regards
Bernd
I'm new to this forum. So please be patient.
I'm creating some checks for an AVM Fritz!Box.
For some of them I have to deal with SOAP-XML.
This is a simplified check (at least the starting point):
Code:
var params = JSON.parse(value);
var requestBody = '<?xml version="1.0" encoding="utf-8"?><s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Header><h:InitChallenge xmlns:h="http://soap-authentication.org/digest/2001/10/" s:mustUnderstand="1"><UserID>admin</UserID></h:InitChallenge></s:Header><s:Body><u:GetForwardNumberOfEntries xmlns:u="urn:dslforum-org:service:Layer3Forwarding:1" /></s:Body></s:Envelope>';
// Initialize challenge with Fritz!Box
var url = 'http://192.168.178.1:49000/upnp/control/layer3forwarding';
var request = new HttpRequest();
request.addHeader('Content-Type', 'text/xml; charset="utf-8"');
request.addHeader('SoapAction', 'urn:dslforum-org:service:Layer3Forwarding:1#GetForwardNumberOfEntries');
var response = request.post(url, requestBody);
return JSON.stringify(response);
But in my Script-Item I alway get a '404 - NOT FOUND'.
For me it seems that there's a problem with POST on a HttpRequest.
GET (with of course a different endpoint) works fine.
Any suggestions?
Best regards
Bernd

Comment