I have just completed my first WCF REST api that makes use of JSon for posting data back to a client app. As part of the dev process I made a quick sample c# forms app for testing. I serialize the incoming Json response and bind to gridview. An example would be of retrieving Balances for the associated ID's of accounts. I have yet to host this, but the idea is to host it on a client server, and for them to be able to develop 3rd party apps.
I really really want to develop a simple sample Windows Phone or Android app, for showcasing as well as learning how to access this hosted service. I have found plenty of articles on accessing via being connected to wifi. But, say I want to develop an app and distribute this on an app store. For users connecting via mobile connection, say 4G, how would this be achieved? If I host via IIS on a server, would I be able to use the URL in a client Android/Windows phone etc. app, authenticate via an API key and retrieve the data?
Please can someone advise on how to go about or where to start please?
Thanks in advance.
You would buy windows web hosting and deploy the WCF REST app there, it would be available on a global domain like http://myapp.com/wcf-app.
Android & iPhone apps would connect to the global address and view the information from the JSON requests, as could any one with a browser.
Related
I have a desktop app with WinForms.
Now I need to create an app that could collect data from my desktop app via internet. I mean that it is shuld be hosted somewhere in inetrnet
For example data is: is app online/ofline, and some information about computer where desktop client is launched.
And also I will need to develop a site where I can look throught this data.(think it will be ASP.NET)
I'm going to use WCF.
Is it good idea?
Maybe there are some other technologes?
WCF is good idea. but if your application will use only http protocol then you should gave preference to web api.
I have a cross platform app currently designed using xamarin forms but now need to use this to create a user profile for the user, using the information provided, for a website.
Are there any add ons or plugins for something like square space or wordpress which would allow me to upload a user program via a RESTful api or something along those lines?
Basically what are my options to transfer user data from a cross platform app to a web app so that my user can then log onto the web app and see all their information?
All you need is a database that can be accessed by both your web app and your mobile app. There are numerous services that would allow you to do this.
But if your web site is going to be a WordPress site (I have never looked into squarespace) then it already uses a MySql back end for data storage. I would imagine squarespace uses a database of some sort as well. You could then create RESTFul urls on that same server to send and request data and use whatever database system that your website is using. If you don't want to implement your own service code for sending and receiveing data that can be used by both your web app and your mobile app, then you could use some service like Azure, AWS, Apigee, etc. just for the database.
I have developed a web application in C# and an android app. Web app(c#) is acting as a server and attached to SQL server 2008 R2 while android is acting as client and it communicates with web app(C#) via bluetooth( bluetooth coding is done in c# winforms).
Now one thing I know is that android cannot directly communicate with SQL database for it I have to utilize web service. I wanted to authenticate my android app login/register from web app(C#)
My winform(C#) in which bluetooth(using feet32 library) functionality is implement should act as an agent between client(android) and server(C#).
Now I wanted to know that:
How my winform application will act as an agent to communicate with client and server both and read/send data to and fro.
If I need web service to implement then in which application I should write in webapp or winform?
I wanted to authenticate my android app login/register from web app(C#). I f I have to write for it webservice then whether I will write it in web app or winform?
I am just a beginner and its my final project. Please help me to understand the complete scenario and my knowledge is too little and also if there is any good tutorial for any of these functionality please do mention the link ..
Thanks
Edited: After little Research I come to know about SOAP http web service, What you guys think where to implement this web service according to above questions.
To establish communication between two devices by using Web services you don't have to use winform application.
You can establish a connection via web services, just create a new ASP.NET project using visual studio then add a Web service and folloe the template it gives you.
Right click on the service, click on view in browser, verify there is no any error. The address of this browser is the address of your service just connect to this service from the second device.
Please check out this guideline: CodeProject Web Service
Try ICE, It got excellent cross platform support and is open source. I have been using it for last four years to communicate between c++ and C# applications.
ICE for .Net
ICE for Android
I want my web app (running in a browser) to, at some point, communicate (bidirectionally) with a desktop app (in Windows), the client has installed in its computer.
What's an elegant and modular and simple way of doing this (with Java and C#)?
Not much information will be passed between the web app and the desktop app. Just something like "I was here", "Pick this from this point", etc.
I solved that problem by using a database on the network.
All communications where made trough the database.
Website -> DB -> User logged in <- DB <- Desktop
However, if no trusted information needs to be shared, you could consider just posting and reading some http headers to a common website, or a simple log file.
Greetings
I suggest you to use the backend part of your webapp, assuming that your app is based on some backend services.
You have two options:
Your desktop apps use the same services of your web app. You must use a class that mimic a web-browser to give the data (curl, ie). If your web app is based on AJAX push ( APE Server i.e ) use library that is able to run some javascript
Use a REST protocol, with a JSON format in your backend services. It's easy to manage and is supported by many client-side languages (java/c#/python....)
Use a specialized endpoint only for your desktop app,for C#, you can use WCF, that allow you, in one of his forms bidirectional communications. For JAVA, there are WSDL, DWR
My preferred solution is to decouple the web app in a front-end side and a backend side, that expose the services as REST that are used by the web app via AJAX.
If I need true bidirectional communication with other desktop app, I'll create a separate service / endpoint for it. (APE , WCF, ..)
I see several options to achieve part of what you are asking:
Besically you expose the relevant parts of your apps (web and desktop) via some sort of API and use that for the communication - for example DB and/or WCF (SOAP/REST/whatever).
BEWARE:
If you are after some sort of direct/interactive communication between both apps on the same computer then this won't be possible - at least not without some security related issues.
The browser executes your web app in a sandbox which doesn't allow for direct communication between the web app and the desktop... there are technologies which can help circumvent that (ActiveX, signed Java applets, some Flash technology called AIR etc.)... or you could host some webbrowser/control in your desktop app which in turn runs the web app... BUT basically I would recommend against using any such measures...
IF you really want to go this route then please describe your environment and goal with much more detail.
I am thinking about writing an application that will monitor IIS Service with iPhone, and send notification, perform resets if an IIS goes down.
I dont want to create a web service to do that but rather connect to a machine, specifying credentials and then get data from the IIS Service state.
Is it even possible?
Is it possible with iPhone?
I need to make this app generic enough for people to use with their hosted web sites and monitor their health and being able to reset it and/or recycle AppPools. I cant implement a service for any hosted environment. I need to be able to give the iPhone users an ability to connect to their host and once you are connected to the machine and authenticated to perform WMIs the phone users can mess with the iis. Is it possible?
I see your point not wanting to use web service because you want to monitor and reset IIS service, while web service is based on IIS. How about RestFul service? I have created RestFul service based on OWIN (Open Web Interface for .Net) and Kayak. Kayak may have some examples there.
The cool thing about those tools or lib is that the framework is very simple and does not rely on IIS. You can provide two URLs, one for get and one for post. The former is to get status of IIS server and post is to reset IIS. Those services can be just XML of JSON based objects and it will be up to the the OWIN service to do the job on the back end. Another great feature of this is that you can even create the service in a console app or any other ways (Windows service or Window Form in system tray) on WindowsXP or Home version. The app will provide RestFul service based on HTTP with specific port.
RestFul service is available for variety of platforms, including iPhone.
Although IIS supports remote administration I doubt there's a way to implement it on the iPhone easily.
You could write an actual Windows Server (not a web service) you could connect to with a socket which can do all the monitoring instead though.