iPhone communication with Windows C# App - c#

I am create an iPhone app that needs to talk to a Windows C# app. The app will run as either a Service or Form Application.
What would be the best way to accomplish this? Ideally exposing a service-type architecture would be best as I don't need a stateful connection (stateless is fine in this case).
Can a WCF service hosted by my app using a form of TCP binding be consumed by my iPhone? Or can an app host using httpBinding without the aid of IIS or some other web server?

To run WCF on iPhone you need MonoTouch. Currently, which isn't completely implemented.
I don't think it's a good idea.
Web Service are a better idea in my opinion. You can spawn a web service listener from your console/gui/service Windows C# application.

Here's what I ended up doing:
In my .NET windows service, I created WCF service bound using a WebHttpBinding endpoint. Doing so exposed my WCF services as JSON.
From the iPhone, using Objective-C, I used the ASIHTTPRequest and json-framework libraries to talk to and parse the JSON web service exposed by my .net app.

Expose your C# application functionality as a ReSTful web service. More information on exposing WCF service is available here
And there are project templates available for creating REST WCF service. Download the WCF REST starter kit.You can expose your service in XML/JSON format.
Then from your iPhone app, you may consume the web service exposed.

Related

Saving Variables Across Calls in WCF as a Windows Service

I created a WCF Service Library, which I host via a Windows Service.
Is it possible to save information across API calls?
I know that if I host the WCF Service Library in IIS with ASP.Net compatibility turned on and making a few modifications to the WCF library that I can use
HttpContext.
HttpContext.Current.Session["name"] = <value>;
WCF started as a Windows Service does not have ASP.Net support to the best of my knowledge, as the library is not hosted by IIS. Is there a way for a WCF library launched via a Windows Service to save information across calls for a specific caller?

Can PHP interact with WCF web servives

My company currently have web services written in WCF in C#, I have been asked to adjust my interface to interact with the web services, the interface is written in PHP/HTML. It will be running VIA IIS as well as the services.
Is this possible or do I need to tell me boss we need to go back to the drawing board
WCF Services can be accessed by any other application that is built on any platform and using any programming language.Web services are interoperable.
You can either expose a REST endpoint:
http://msdn.microsoft.com/en-us/magazine/dd315413.aspx
Or just put a ASP.Net Web API in front of your WCF service to act as a middle man:
http://www.asp.net/web-api
In php there are a number of ways of talking to a RESTful service, here is one library that can help:
http://phphttpclient.com/

windows service as tier between code and webservice

This might be a simple question, but is it possible to use a windows service as a tier between my code and a webservice?
I have a rather large project, and a webservice. Instead of calling the WS directly, I need a tier inbetween. (There are reasons to why that's a good idea...)
Since a windows service is all ready present, can I call that service, and get that same service to call the webservice?
You could use wcf to communicate with a windows service, that than communicates with a webservice.
Or you could host a web service in the windows service, that communicates with the original webservice.
That are just two examples, so it es technical possible to match you requirements.

Create C# SOAP API Consumable by other Languages

I've been trying to find a tutorial on here, MSDN, and Google on how to implement my own SOAP API. I have an application written in C# that I want to be consumable by PHP so that calls from the web can interact with the application. How do I generate and tie a WSDL file to my application so that it can be communicated with over SOAP calls? Any suggestions?
I think for this you just need to create WCF service in .net that will allow you to consume server from any language.
Create an ASP.Net Web Services .wsdl file to communicate with the various applications. Host the Web Service on windows IIS server and configure the ports accordingly, then you can access the endpoints to whcih ever application you are using, using the address and the web method name.

.net web service hosted within my application

I'm migrating an old Delphi application that I wrote into C#. The application is a datalogger that exposes logged data requests via a SOAP web service interface.
The web service is contained with the delphi graphical windows application, i.e. no need to run a web server like IIS, etc I just run the application and it's up and running under the hood.
I'm looking to do the same in my c# Windows form application, I can find loads of resources on writing web services that are ultimately hosted within IIS but am struggling to find a solution for a self contained web service within my application.
Does anyone have any suggestions or can point me towards any resources on this?
The web service does not neceserily have to be SOAP, REST is fine (in fact probably prefered).
Look into WCF Services.
Hosting and Consuming WCF Services
Hosting WCF services in a Windows Forms Application
The System.Web.Hosting namespace allows you to host ASP.Net pages without using IIS within your applications. I have never used it to host web services but I found a tutorial that seems to provide a guide on doing this-
http://msdn.microsoft.com/en-us/magazine/cc163879.aspx
If you're wanting to host a service inside your application, it's possible with the System.ServiceModel.ServiceHost class. You need to learn WCF first, but that at least answers your question to get you started. If you have any further questions, leave me a comment or two and I'll update my answer to accommodate your inquiries.

Categories

Resources