开发者

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 jquer开发者_如何学编程y 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"; }
}


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜