Is Web API supporting pushing to clients? - push

Is new Web API supporting pushing messages to clients (instead of continuous polling)?

Not out of the box. Take a look at SignalR to enable this scenario.

Related

Rest/Graphql apis and event driven architecture

I've been looking at the event driven architecture and it's seems it might be the right architecture for a project I'm working on.
But there is one thing I don't really get yet, what is the best practice/common pattern when your micro services are being consumed by front-end applications?
For my project, I have a web app and an iOS and Android app.
Let's take a simple case of a feature letting users create their profile.
Let's say I send the profile data via REST/GraphQL to the api endpoint which triggers microservices (running behind Kafka or Pulsar).
How can I get the result of the profile creation and then maybe use it on the next screen?
Cheers
websocket calls to Pulsar will do most of what you want https://pulsar.apache.org/docs/en/client-libraries-websocket/
You could also call Apache Pulsar via MQTT which is not too uncommon from cell phones.
Or use a REST gateway or microservice between the app and Pulsar services. I use Apache NiFi for that.

Api monitoring .net

I am novice in Web API. Apologize if any question is not making sense.
I have several Web APIs developed in .NET and hosted on the same sever. These APIs are consumed by different applications. Here I wanted to monitor APIs. Monitoring includes:
How many applications are consuming my API?
How many hit counts to the API by different applications?
Is there any why we can restrict an application to access the application(ex. An application is given only 5 hits to the api per day)?
And also it would be helpful, if there are any tools available to do the same.
Thanks in advance
You can check out Treblle .Net SDK.
Treblle lets you monitor and observe your API and all the features you listed are packed in Treblle.
https://github.com/treblle/treblle-net

Sending data to RESTful web services from iOS app

I am facing a challenge to upload & download data, to and from the server using RESTful web services.
Is it possible to use a RESTful service client, if possible any way to achieve that in an iOS app to send data to the service.
#Ajay: As Claus mentioned there are number of public frameworks/wrappers are there, you can use them for RESTful service interaction from your code. The one I frequently use is ASIHttpRequest, quite handy and easy to use. There are enough examples out there with ASIHttpRequestyou can use it as reference.
Let me know if that helps.
You question is not clear. Do you need to push data from the server to the iOS app using a REST service?
If so, REST does not provide an interface for push. (It only provides a client->server Create/Read/Update/Delete API).
Take a look at ASIHTTPRequest or use RestKit for some more advanced stuff!
RestKit works really nice!

soap connection through jquery in phonegap?

is it possible to do cross domain through j query in phone gap? I know cross domain will be supported in phone gap. can we do SOAP,REST web services through phone gap using j query?
Yes you can use web services calls in phonegap. When I developed for iphone using phonegap we used a ton of web service calls to update and push and pull data to our servers.
http://api.jquery.com/jQuery.ajax/
or post methods would work.
Just look for examples on the web to jquery ajax calls i just used json to push and pull data but implementing a soap call shouldn't be that much harder.
it is possible, if you upgrade your Webservices to handle JSONP calls instead of JSON/SOAP. With the help of JQuery.Ajax, you can call these services remotely.
If you're using .Net Webservices, here's a fine example:
http://bloggingabout.net/blogs/adelkhalil/archive/2009/08/14/cross-domain-jsonp-with-jquery-call-step-by-step-guide.aspx

Cross platform WCF service

I want to use a WCF service and consume it using all the mobile platforms iPhone, android, Blackbery, Nokia etc'
Whats my best strategy for using those clients with a WCF service. it will have to be secured of course.
Thanks
amit
I disagree with SOAP and JSON. Use RESTfull service with POX (plain old xml). It will be most probably supported by all platform. Mobile phones can have limited SOAP stack implementations and JSON is usually used with browsers. My friend has BlackBerry and he continuously complains about its support for JavaScript.
To secure your service use HTTPS.
Use a SOAP or JSON endpoint. Most platforms will have support for these (or it'll be easy to find libraries). JSON is more web oriented (Javascript) but will work in other situations as well.
Mono supports WCF so maybe their iPhone and Android will support it as well.
Totally agree with #Ladislav on not expecting clients to be able to consume SOAP. Seems like SOAP stacks are lacking unless your client is native .NET or Java. Your clients will thank you by allowing them to choose JSON (web clients) or XML (system integration). Secure via HTTPS and basic auth or an API key.
If you already have an existing infrastructure of WCF services that you want to aggregate, or adapt, for downlevel clients you could put that POX (or 'REST') service in front of them and let it handle mapping protocols and formats for you. e.g. HTTP/S to TCP/IP and XML or JSON to SOAP.
The upside is that you will make it easier for downlevel clients to consume your services. The downside is that you've added an extra layer, which will cause complexity. Some tools, like WCF Routing Service (free) or Apigee (commercial), coupled with a solid automated deployment proces can help mitigate this complexity.
To build a REST service that supports XML or JSON, create your service with this template, it's designed for .NET 4.0. From there you can configure endpoints that respond in XML or JSON and let your client tell the service what response type it wants.
EDIT You can also have the service respond in a default format to reduce every client having to specify what format.
<standardEndpoints>
<webHttpEndpoint>
<standardEndpoint name="" defaultOutgoingResponseFormat="Json"/>
</webHttpEndpoint>
</standardEndpoints>