Jag fösöker komma åt ett datavärde via REST, men när jag försöker med
http://172.24.74.10:8800/datasources/5
så får jag bara tillbaka
<?xml version="1.0"?>
<RESTDataSource xmlns="http://SwitchKing.Common/Entities/RESTS ... ed/2010/07" xmlns:i="http://www.w3.org/2001/XMLSchema-instance" i:nil="true"/>
Hur formatterar jag anropet för att se aktuellt värde för en datakälla?
REST / Linux
Forum rules
För att kunna hjälpa dig med supportfrågor behöver vi så mycket information som möjligt.
Innan du skapar en ny tråd, läs gärna:
viewtopic.php?f=10&t=20
För att kunna hjälpa dig med supportfrågor behöver vi så mycket information som möjligt.
Innan du skapar en ny tråd, läs gärna:
viewtopic.php?f=10&t=20
-
- 4 stars
- Posts: 278
- Joined: Tue 09 Nov 2010, 21:51
Re: REST / Linux
Så här ser min motsvarande ut:
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<RESTDataSource xmlns="http://SwitchKing.Common/Entities/RESTS ... ed/2010/07" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<Description>id 5</Description>
<Enabled>true</Enabled>
<EngineeringUnit>°C</EngineeringUnit>
<EvalMinMax>false</EvalMinMax>
<ID>5</ID>
<LastRun>2011-05-03T23:45:15.8322946</LastRun>
<LastValue>21,4</LastValue>
<LastValueAdditionalData>Saved through REST</LastValueAdditionalData>
<LastValueDebugInfo>Saved through REST</LastValueDebugInfo>
<LastValueExpires>9999-12-31T23:59:59.9999999</LastValueExpires>
<LastValueIsFailureValue>false</LastValueIsFailureValue>
<LastValueLocalTimestamp>2012-02-08T05:10:30.6064326+01:00</LastValueLocalTimestamp>
<LastValueStatus>OK</LastValueStatus>
<LastValueTimestamp>2012-02-08T05:10:30.6064326+01:00</LastValueTimestamp>
<Name>17: Sovrum</Name>
<NextRun>2011-05-03T23:55:15.8322946</NextRun>
<PollScheduleRate>PT0S</PollScheduleRate>
<PollScheduleType>WhenModified</PollScheduleType>
<PollScheduleValue>PT0S</PollScheduleValue>
<Status>Failure</Status>
<UsedValue>21,4</UsedValue>
<UsedValueAdditionalData>Saved through REST</UsedValueAdditionalData>
<UsedValueDebugInfo>Saved through REST</UsedValueDebugInfo>
<UsedValueExpires>9999-12-31T23:59:59.9999999</UsedValueExpires>
<UsedValueIsFailureValue>false</UsedValueIsFailureValue>
<UsedValueLocalTimestamp>2012-02-08T05:10:30.6064326+01:00</UsedValueLocalTimestamp>
<UsedValueStatus>OK</UsedValueStatus>
<UsedValueTimestamp>2012-02-08T05:10:30.6064326+01:00</UsedValueTimestamp>
</RESTDataSource>
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<RESTDataSource xmlns="http://SwitchKing.Common/Entities/RESTS ... ed/2010/07" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<Description>id 5</Description>
<Enabled>true</Enabled>
<EngineeringUnit>°C</EngineeringUnit>
<EvalMinMax>false</EvalMinMax>
<ID>5</ID>
<LastRun>2011-05-03T23:45:15.8322946</LastRun>
<LastValue>21,4</LastValue>
<LastValueAdditionalData>Saved through REST</LastValueAdditionalData>
<LastValueDebugInfo>Saved through REST</LastValueDebugInfo>
<LastValueExpires>9999-12-31T23:59:59.9999999</LastValueExpires>
<LastValueIsFailureValue>false</LastValueIsFailureValue>
<LastValueLocalTimestamp>2012-02-08T05:10:30.6064326+01:00</LastValueLocalTimestamp>
<LastValueStatus>OK</LastValueStatus>
<LastValueTimestamp>2012-02-08T05:10:30.6064326+01:00</LastValueTimestamp>
<Name>17: Sovrum</Name>
<NextRun>2011-05-03T23:55:15.8322946</NextRun>
<PollScheduleRate>PT0S</PollScheduleRate>
<PollScheduleType>WhenModified</PollScheduleType>
<PollScheduleValue>PT0S</PollScheduleValue>
<Status>Failure</Status>
<UsedValue>21,4</UsedValue>
<UsedValueAdditionalData>Saved through REST</UsedValueAdditionalData>
<UsedValueDebugInfo>Saved through REST</UsedValueDebugInfo>
<UsedValueExpires>9999-12-31T23:59:59.9999999</UsedValueExpires>
<UsedValueIsFailureValue>false</UsedValueIsFailureValue>
<UsedValueLocalTimestamp>2012-02-08T05:10:30.6064326+01:00</UsedValueLocalTimestamp>
<UsedValueStatus>OK</UsedValueStatus>
<UsedValueTimestamp>2012-02-08T05:10:30.6064326+01:00</UsedValueTimestamp>
</RESTDataSource>
-
- Administrator
- Posts: 2655
- Joined: Tue 09 Nov 2010, 20:25
Re: REST / Linux
Det finns en begränsning i Mono-implementationen på Linux som gör att REST-anrop inte fungerar på samma sätt från en webbläsare mot Linux-miljö som mot Windows-miljö.JanJoh wrote:Hur formatterar jag anropet för att se aktuellt värde för en datakälla?
I Windows-miljö så kastas det tillbaka en begäran om användarnamn och lösenord men på Linux så krävs att man skickar med dessa från början.
Om webbläsaren stödjer det så kan du ange "http://user:pass@172.24.74.10:8800/datasources/5".
Martin | Switch King
-
- 2 stars
- Posts: 18
- Joined: Thu 20 Oct 2011, 21:27
Re: REST / Linux
Så enkelt var det. Tackar!
Who is online
Users browsing this forum: No registered users and 3 guests