This project is read-only.
mfRCF - micro framework REST Communication Foundation

requirements:

- dynamic Hosting, possibility to implement different Hosting SetUp's
- e.g.: on different Network-API's or even on the big .net framework (netFx) or mono
- this should also ensures the independent testability
- case-invariant path declaration @design-time
- dynamic executable return-types
- (customizable-)basic-http-authentication
- no ssl (or x509-)support
- FUTRE-FEATURE: directory access --> tiny web server

concept:

- use delegates and dynamic-invocation to encounter 'dynamic Hosting'-requirement
- use Composite-Pattern to ensure 'composable-path-map'-requirement
- dynamic definable return-types (mfRcfCommand.ContentType-Out-/-In)

rest-sample-2-implement:

supported HTTP-ACTION-CODES (references2: http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html):
GET
POST usually used 4 insert
PUT usually used 4 update
DELETE

supported HTTP-CODE (references2: http://en.wikipedia.org/wiki/ListofHTTPstatuscodes or http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10):
200 OK
400 Bad Request
500 Internal Server Error
etc. 4 more lookup@ enumHttpStatusCode

for 3-major-scenarios:

1. request-response combination, e.g.: GetSunPosElevation(long : double, lat : double, dt : DateTime) : double
2. request-acknowledge, e.g.: setDate(newDate : DateTime) : bool
3. response, e.g.: '/rss' : </rss>

root on :80
/rss
HTTP-GET
in: void
out: text/xml
<rss/>
(specification@: http://cyber.law.harvard.edu/rss/rss.html)
/state
HTTP-GET
in: void
out: text/xml
<State/>
/Date
HTTP-GET
in:
GET-Parameter: void
out: text/plain current DateTime in Format 'yyyy-MM-ddTHH:mm:ss'
HTTP-CODE
HTTP-POST
in:
GET-Parameter: date : DateTime as string
/led toggles the onboard-led based on the GET-parameter on the netduino
HTTP-GET
in:
GET-Parameter: state : bool
out: HTTP-CODE
TODO: /entities:
HTTP-POST
in:
POST-Parameter: newChild : String
out: HTTP-CODE
HTTP-PUT
in:
(?PUT)-Parameter: child2Update : String
out: HTTP-CODE
HTTP-DELETE
in:
GET-Parameter: child2Delete : String
out: HTTP-CODE

-Netduino-Test-Url's:

http://192.168.70.106/rss
http://192.168.70.106/state
http://192.168.70.106/date
http://192.168.70.106/led?state=true
http://192.168.70.106/led?state=false

-Future-Features:
//TODO: (maybe) create wadl for the rest-sample

Deployment space:

86KB mfXmlSerializer (with references: System.Xml.Legacy, System.IO and System.Ext.xml 'MFDqwsExtensions.dll' included)
+ 36KB HttpReferences (Microsoft.SPOT.Net, System.Http)
+ 10KB mfRCF.Core && mfRCF.netmf itself
= ~135KB

ChangeLog:

v.1.0 (16.02.2014):
initial (running) state
v.1.1 (28.02.2014):
BugFixes: after integration in mfLogger in HttpRequest- and Error-Handling
v.1.2 (05.04.2014):
Extension: RemoveLastSlash() for REST-Paths added to use just Url-string without a slash @theEnd
BugFix: mfRcfCommandCollection.AssertIfPathAlreadyInserted now checks restcmd.name and httpMethod

Last edited Apr 26, 2014 at 11:05 AM by DStegmaier, version 10