arul
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2010
10:06 AM
XML input and Output
Hi,
How to send the xml input toget the xml as ouput
-Arul
How to send the xml input toget the xml as ouput
-Arul
7 REPLIES 7
Anonymous
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2010
01:24 PM
Re: XML input and Output
Arul,
I'm afraid I don't understand what you're asking. What are you trying to accomplish?
I'm afraid I don't understand what you're asking. What are you trying to accomplish?
arul
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2010
04:33 AM
Re: XML input and Output
Hi Patrick,
I am a begginer, the sample application what i tried initally was just to display some posters and click the poster to play video. I used the videoplayer example soure code and modified categories.brs for input xml . I had all other xmls to display Info.
conn.UrlPrefix = "http://rokudev.roku.com/rokudev/examples/videoplayer/xml<-- replaced with my xml directory"
conn.UrlCategoryFeed = conn.UrlPrefix + "/categories.xml<-- replaced with my xml page"
Now i want to try the same thing with webserivce HTTP POST request instead of directly giving the xml soruce as categories.xml. I have webservice which accepts only XML input and returns the categories.xml as ouput.
where can i find the sample code for HTTP Post request
which ifUrlTransfer interface function i have to use for HTTP POST request.
-Arul
I am a begginer, the sample application what i tried initally was just to display some posters and click the poster to play video. I used the videoplayer example soure code and modified categories.brs for input xml . I had all other xmls to display Info.
conn.UrlPrefix = "http://rokudev.roku.com/rokudev/examples/videoplayer/xml<-- replaced with my xml directory"
conn.UrlCategoryFeed = conn.UrlPrefix + "/categories.xml<-- replaced with my xml page"
Now i want to try the same thing with webserivce HTTP POST request instead of directly giving the xml soruce as categories.xml. I have webservice which accepts only XML input and returns the categories.xml as ouput.
where can i find the sample code for HTTP Post request
which ifUrlTransfer interface function i have to use for HTTP POST request.
-Arul

RokuKevin
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2010
06:07 PM
Re: XML input and Output
There is no synchronous roUrlTransfer method for an HTTP Post. Instead, use the asynchronous method AsyncPostFromString() or AsyncPostFromFile() to post the Body.
Example:
Example:
url = "<your POST URL>"
body = "<your POST Body>"
obj = CreateObject("roUrlTransfer")
obj.SetPort(CreateObject("roMessagePort"))
obj.SetUrl(url)
timeout% = 1500
num_retries% = 5
str = ""
while num_retries% > 0
if (obj.AsyncPostFromString(body))
event = wait(timeout%, obj.GetPort())
if type(event) = "roUrlEvent"
respCode = event.GetResponseCode()
if respCode = 200 then
return event.GetString()
else
return invalid
end if
elseif event = invalid
obj.AsyncCancel()
obj = CreateObject("roUrlTransfer")
obj.SetPort(CreateObject("roMessagePort"))
obj.SetUrl(url)
timeout% = 2 * timeout%
else
print "roUrlTransfer::AsyncPostFromString(): unknown event"
endif
endif
num_retries% = num_retries% - 1
end while
ErlyD
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2010
11:04 AM
Re: XML input and Output
Can this method be used to send commands? select home, select up, etc...?
What would it look like?
What would it look like?
hpatel18
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2010
03:27 PM
Re: XML input and Output
Hi,
a) I would like to consume my webservice in my channel. how can i do that?
b) After consuming the web service, i would like to show the data in real time either by using video or by image. is it possible?
a) I would like to consume my webservice in my channel. how can i do that?
b) After consuming the web service, i would like to show the data in real time either by using video or by image. is it possible?

RokuKevin
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2010
08:41 AM
Re: XML input and Output
ErlyD, there is not currently a documented way to send commands to the Roku DVP. There is a way, but we are looking at formalizing a new interface for doing this. Look for more info soon...
hpatel18, You can use the techniques earlier in this thread to consume your web service. You are basically using these components; roUrlTransfer to GET/POST http connections. You will send String xml requests and parse responses using roXMLElement and roXMLList or the BrightScript language XML support.
--Kevin
hpatel18, You can use the techniques earlier in this thread to consume your web service. You are basically using these components; roUrlTransfer to GET/POST http connections. You will send String xml requests and parse responses using roXMLElement and roXMLList or the BrightScript language XML support.
--Kevin
saravanainfo
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2011
01:05 PM
Re: XML input and Output
Hi, you said you replaced it with your xml directory, i am trying to do the same... how do i do that?
conn.UrlPrefix = "http://rokudev.roku.com/rokudev/examples/videoplayer/xml<-- replaced with my xml directory"
conn.UrlPrefix = "http://rokudev.roku.com/rokudev/examples/videoplayer/xml<-- replaced with my xml directory"