Name: instantiation/test/ruby/instantiate.rb
| 1: | #!/usr/bin/ruby |
| 2: | # encoding: UTF-8 |
| 3: | require 'rubygems' |
| 4: | require 'riddl/client' |
| 5: | |
| 6: | srv = Riddl::Client.new("xmpp://[email protected]","http://fp7-adventure.eu:9296/?riddl-description",:jid => 'jü[email protected]', :pass => 'mangler', :debug => STDOUT) |
| 7: | res = srv.resource("/") |
| 8: | status, response = res.post [ |
| 9: | Riddl::Parameter::Complex.new("xml","application/xml",File.read('description.xml')), |
| 10: | Riddl::Parameter::Simple.new("targetmode","ready") |
| 11: | ] |
| 12: | p status |
| 13: | ins = response[0].value |
| 14: | p ins |
| 15: | |
| 16: | res = srv.resource("/#{ins}") |
| 17: | status, response = res.get |
| 18: | p status |
