How to connect to a relay service hosted on the service bus in iOS - ios

I want to use Azure service bus in my iOS app to communicate with server i have went through the below link. its pointing to C#.Need suggestions to work on iOS.
http://azure.microsoft.com/en-us/documentation/articles/service-bus-dotnet-how-to-use-relay/#next_steps

You may want to consider using WebHttpRelayBinding for your service so you can hit the Azure endpoint using HTTP / HTTPS.

WCF supports both RESTfull and classic SOAP style messaging but using lightweight json requests in a RESTfull service would be better from a mobile app.
read the following article for details. but you don't need to write custom autostarter if you are using IIS 7.5 or greater with appfabric, since it has autostart functionality in built.
http://msdn.microsoft.com/en-us/library/hh966775.aspx
if you don't need request-response messaging pattern then you can also consider service bus queues for persistence, and your on-premise process can pull and process the messages at its own pace.

Related

Which Google Cloud products do I need for my use case?

I wish to route a phone call to an ASP.NET MVC web app that is hosted on a server, and then open a web socket to gain access to the call's audio. I am not concerned about how to access the audio or process it etc. All I am needing help with is hosting a web app and opening an accessible web socket.
I have tried app engine, but with little success as I couldn't manage to open a web socket... I was able to get everything working with Azure services, however, I would like to transfer my web app to Google's services.
Can I stil use app engine to host the ASP.NET MVC app? If so, how can I open a websocket?
Thanks
You can host ASP.NET apps in App Engine Flexible but can't use websockets YET.
As for comment 231, it seems that its release in Flexible environment is likely in the not so distant future.
This is currently not possible with Google App Engine. However, you can always use Google Compute Engine, which is essentially a VM in Google's network that you can configure as your own webserver and you have virtually full control of its connectivity and ports.

Why is it not recommended to host receive endpoints in a web application using MassTransit?

I am working on an ASP.NET MVC 5 application (based on nopCommerce). I want to use MassTransit to communicate with another application that is used for inventory management, billing, etc. It would be easier if I could add receive endpoints directly into the web application and not have to create a Windows service for that. But the MassTransit documentation says it is not recommended and there is no explanation as to why that is.
MassTransit in a web application
Configuring a bus in a web site is typically done to publish events,
send commands, as well as engage in request/response conversations.
Hosting receive endpoints and persistent consumers is not recommended
(use a service as shown above).
Does anyone know the reasoning behind it? Is it not safe to add receive endpoints in a web application? Will they not work properly?
Hosting endpoints in a web application is not recommended because web applications often restart for various reasons. These reasons are typically outside the control of the application itself.
While using a standalone Windows service is highly recommended, as long as the bus is properly started and stopped using the Application_Start and Application_End methods, it can be okay if you have no other options available.

Using Service Bus for Asp.net Web API

I am developing Services using ASP.NET Web API and have plan to use Service Bus for message exhanging. Is it possible to use Service Bus along with ASP.NET Web API?
And what are the Microsoft's Answer for Service Bus other than Windows Azure service bus?
There is absolutely nothing stopping you from using a service bus with ASP.NET Web API.
I am doing exactly this (web api) in a project I am implementing where a user registers and I need to send an activation e-mail. The e-mail sending is handled from a service bus endpoint so that the registration from the web api returns immediately.
I have also implemented my service bus in a production system although it is MVC 3 (4 web servers).
Although any service bus should do the trick (NServiceBus, MassTransit, etc.) you may want to have a look at my FOSS Shuttle ESB project: http://shuttle.codeplex.com/
Have you looked at Microsoft Service Bus 1.0?
http://msdn.microsoft.com/en-us/library/windowsazure/jj193022(v=azure.10).aspx
(it includes messaging and queuing features from the Azure Service Bus)
For distributed caching (i.e. Caching Service in Azure)
AppFabric 1.1 for Windows Server has as lot of features
http://www.microsoft.com/en-us/download/details.aspx?id=27115
You can absolutely use the Caching Service in the ASP.NET Web API. I have not tried the Microsoft Service Bus 1.0 for messaging/queuing on Web API.

Best choice for robust self hosting server: WCF vs. ASP.NET Web Api

We currently have an .NET 4 application that consists of Windows Service running in the background and local or remote clients (only 1-3 normally).
The clients have a WPF GUI and need some data from the windows service. Therefore, we use WCF with NamedPipe binding for a local client and NetTcp binding for remote clients. This works, but we often have problems with endpoints that are not reachable (channel faulted or not found etc.). We already try to rebuild faulted connections but it seems to be pretty fragile...
Now enter Web Api: It looks like a HTTP based stack might be more robust (no channels, no endpoints, can be self-hosted in windows service as well). There seems to be no problems with broken channels because each request is handled individually. So if something fails, you just repeat the request. (And we have experience with ASP.NET MVC from other apps, so this not new to us).
Now we are thinking what might be our best bet. Is it better to "harden" our existing WCF service (one service interface with about 15 operations) or to move the interface to Web Api and run it as HTTP requests (with JSON data)? Performance is not our main issue here...
Any ideas?
Hartmut
I recommend you stick with WCF (SOAP) services for your WPF application rather than moving to the Web API. There are a number of reasons for this. First I think we need to consider what the new Web API is trying to address - namely to provide a framework for supporting RESTful/HTTP/hypermedia services. This is likely to be a good fit for building applications that make heavy use of HTTP such as web, mobile and JavaScript applications, where you want to maximise the "reach" or interopability of your services (irrespective of platform). This is not to say that you can't use it for WPF clients but in your case, where all traffic is local to your domain, it makes more sense to stick with your current implementation.
The binding choices you have made for your services / clients sound ok to me. I would focus on why your channels are faulting and address these issues. You may also want to consider hosting your services via IIS and use WAS to expose your non-HTTP endpoints. I have had much success with this in the past and for the most part has been pretty stable. It also takes away a few of the headaches with managing your own host. If you are concerned about the TCP binding faults, then just create a new HTTP or wsHTTP endpoint and use that instead. This will provide you exactly the same transport the web api uses without having to change your programming model.

EHR intercommunication / client

So, I'm researching methods for building a client interface for existing EMRs. I've read tons of info on HL7, as well as the various coding schemes, but I'm still really clueless.
For anyone whose worked with an EMR before: is it possible to build a web interface that can use HTTP-POST and HTTP-GET requests to pull/push data to the server database? Or would you have a separate database for the client, say a web application, then use some interface engine like Mirth to communicate between the EMR database and the web application?
A web service API is definitely a way to go. One benefit to this is that you can get https almost out-of-the box for encryption of data in transit.
The way we have configured our EMR is that we have a tcp server accepting incoming hl7 messages from certain IPs which connects directly to our EMR database. This can be beneficial by separating emr and interface processes (You don't have to restart your whole EMR if the interface goes down, for instance).
Another good feature would be to have a token system for pseudo-authentication. This only works if you are going over a secure connection though.
If you aren't into writing your own tcp server (not that hard), an api-based server is probably just as good.
EDIT: What language(s) do you think you'll be using?
Other things that you might run into:
Some applications prefer file drops to direct calls (either url or tcp)
Some vendors will have their own software that sits on a server of yours
Don't forget the ACK.
I don't see why you couldn't do this. You would need to build the web service to handle requests with a specific Uri. When this Uri is called the web service uses the data sent with the request to make changes in the database.
Once you had the web service built, you could build some sort of front-end that displays your information to the user. And makes HTTP-GET and HTTP-POST calls.
There is a lot of flexibililty in what you are trying to do... so go with a plan for sure.
In general though you should be able to accomplish what you need to do by building your own web service and front-end application that is able to manipulate an EMR database.
It really depends on your architecture and requirements.
Architecture 1
If you want your client to be web based, but your client is a separated app from your backend, then the web sends the info using HTTP to your client app server side, and then, that will send info to your EHR backend (another app). That second communication might be written using a standard, that will help you on integrating more systems with your backend in the future. So that interface can be HL7 based, if HL7 v2.x is used, take a look at the MLLP protocol: http://www.hl7.org/implement/standards/product_brief.cfm?product_id=55
This is the most performant way of communicating HL7 data. If you don't want to deal with TCP, there is a proposal for HL7 v2.x over HTTP. HAPI implemented that: http://hl7api.sourceforge.net/hapi-hl7overhttp/
If you don't want to use HL7 v2.x but HL7 v3 (a different standard, not really a version of 2.x) or CDA, you can use HTTP or SOAP.
Architecture 2
But, if you want your client just to be a UI on the user side (browser), HTTP POST will suffice to send info from the browser to the server. That means your EHR is a centralized EHR with a web iu.
In the 1st architectural case, first case you'll probably have multiple client apps (full EMRs apps) and a backend EHR server (centralized backend). On my developments I follow this second architecture.
Also there Mirth might help to manage all the communications between client apps and backend apps. In the 2nd case, using Mirth is nonsense, is just a web application and the client communicates directly with the web server. Of course, you can use Mirth as a web server, but that's not it's role, it is an ESB no a web server.
Hope that helps!

Resources