c# - WCF Operation contract type in case of Push Notification message receiving? -


i have restful wcf service used read data push restful service hosted somewhere on internet. have expose 1 method read json data push other service.

[servicecontract] public interface itestservice {     [operationcontract]     [webinvoke( method = "get",         responseformat = webmessageformat.json )]     string getdata(string jsondata); } 

is fine receive push message in method ? push service can send bulk of data @ once. how can restrict server works fine bulk data.

regards

i have restful wcf service used read data push restful service hosted somewhere on internet.

"push" wrong word; it's evocative of server-push, has different meaning way using here. more accurately, have service service call, passing data.

is fine receive push message in method ?

no, it's not fine. operations pass data on query string only. fine (though quite unusual) short strings made of json, longer strings risk violating maximum size limit query string in whatever technology stack happen using.

using post operation work:

[servicecontract] public interface itestservice {     [operationcontract]     [webinvoke( method = "post",         requestformat = webmessageformat.json,         responseformat = webmessageformat.json,         uritemplate = "getdata" )]     string getdata(string jsondata); } 

however, still need process json string manually. usual way of doing define c# type support serialisation of json:

[servicecontract] public interface itestservice {     [operationcontract]     [webinvoke(method = "post",          requestformat = webmessageformat.json,         responseformat = webmessageformat.json,         uritemplate = "getdata" )]     string getdata(mydata data); } 

where mydata c# type corresponds json payload. json cleanly deserialized instance of mydata made available in method.


Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -