pdiddy
pdiddy

Reputation: 6297

jquery with wcf not hosted on IIS

Is it possible to have jquery talk to my wcf service that is hosted as a window service? or it really needs to be hosted on IIS?

Also my regular wcf service don't have all this WebInvoke, AspNetCompatibilityRequirements. In it's current state can I use jquery to talk to my current wcf without making changes to it?

For example,

public interface IMyService
{ 
     [OperationContract]
     string SayHello();
}

public class MyService : IMyService
{
     public string SayHello(){ return "Hello"; }
}

Upvotes: 0

Views: 261

Answers (1)

sandyiit
sandyiit

Reputation: 1705

Technically speaking you can, but it will be a little complex thing. It will technically amount to convert your windows service to a http listener. To do so :

  1. Stop IIS server
  2. Configure your Windows Service to use tcpBindings over Soap
  3. The Windows Service should be bound to port 80 (HTTP)
  4. Start the Windows Service. Make a normal call from browser to see how it works. It should allow exchanged of Xml over Soap.

You can also refer to this question where the user is able to implement a Windows Service over HTTP.

Upvotes: 1

Related Questions