I would like to know how we can consume web services in maximo anywhere apps. Currently im accessing static data from javascript files.Please help with sample code.
Webservice can be invoked using the Javascript adapters which are deployed on the server. The javascript methods in the mobile-app will invoke the methods in the adapter which in turn invokes the methods in the backend.
Sample code can be found in the below URL.
https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/7.1/server-side-development/javascript-adapters/js-http-adapter/#creatingSoapServiceRequest
Related
I want to create the Xamarin Form app for both android and iOS in which when something events occurs or data update on server than server call my xamarin app and i will perform some task in my app. Push notification and SignalR both are not suitable for my case. is there anything like webhook in Xamarin form. There are many example for Web application but nothing i found in case of mobile application.
You can use the RESTful web service as a webhook.
Representational State Transfer (REST) is an architectural style for building web services. REST requests are made over HTTP using the same HTTP verbs that web browsers use to retrieve web pages and to send data to servers.
More informations you can refer to this website:
https://learn.microsoft.com/en-us/xamarin/xamarin-forms/data-cloud/web-services/rest
I have few charts to render in the UI. The data has been populated from multiple tables using a web API service. Whenever a change in the data, I get a notification in the web API service. My question is that, is it possible use signalr to refresh data real-time.
Is it possible to invoke a signalr client methods from the web API service? Your help is highly appreciated.
It is possible to invoke client methods from outside the hub. You need to use GlobalHost to do that. You can find more details in the tutorial.
Just an outline of what I am trying to do.
I have an existing WebApi service that returns the running windows services on a machine. I have a front end hooked up so that it querys the service using jQuery and Knockout.js
What I am trying to do with SignalR is to use it to poll the WebAPi service to always push the latest changes to the client.
Is SignalR the right framework for this?
Can someone provide me an example of calling a RESTful service with SignalR?
What i would really like to happen is if a service goes down that SignalR would raise that all the way through the WebApi to the Client.
SignalR is not the right framework for creating or consuming RESTful services. SignalR is designed to make it easy to push data from the server to the client. REST is designed to support clients making requests and receiving a (near) immediate responses.
You can make requests from a SignalR client to a server-side Hub method, but Hub methods do not expose REST endpoints.
We have this Pub/Sub system that you subscribe to via a callback mechanism in C# to recieve events from various things that happen within the database. This subscription has a callback signature attached to it that allows for the Pub / Sub system to callback any subscribers it has and notify them of the change on that Callback thread.
We are taking our windows application and migrating it into a web application. In doing so, I need a way to update this Web Application (The clients) with information from this Pub / Sub. I want to use SignalR, but not sure where to host it. I assume if I host it on the same Web Application as the Client, it won't be able to subscribe to the pubsub due to it not being able to do background threading.
Currently, I have it in a Console application hosting the SignalR server on a specific port. Obviously this is for testing and not ideal for a larger scale.
My question is.. is it really safe to be hosting SignalR outside of IIS? should I put this in a Windows Service? Web Service somehow? Can it go in a Web Application somehow?
I'll try to make a long story short:
I want to call a method on a hub in a web application from a core assembly in my application. Reason being is that I have a number of applications that all eventually call into core and trigger events (think mobile web, admin site, api, etc). I want to notify users of the desktop site of events as they happen, using SignalR.
To spike this, I created a 4-project solution. A core project with the hub proxy. A web app with the hub. Another web app without the hub. And finally a console app.
If I call into core from the console app, and try to send a message to hub clients using the proxy, everything works great. However, if I try to call into core and use the proxy from one of the web apps, the execution hangs at the call to connection.Start():
var connection = new HubConnection("...");
var hub = connection.CreateProxy("Spike.Hub");
connection.Start().Wait();
Is the SignalR.Client stuff not meant to be used from within a web app's app domain? Why does it work as expected in the console app, but not from a web app?
Update: I hooked my spike into the SignalR source and when running from one of the web apps, execution hangs at line 130 of SignalR.Client.Connection. The _syncContext for such a connection is an instance of AspNetSynchronizationContext, and when calling its Post() method, everything stops.
There's a bug in the SignalR.Client and you found it :)