我设置了所有的端点,绑定和行为以便使用json来使用服务,但现在我无法想象如何生成javascript代理以便通过Ajax从我的客户端访问javascript JQuery代码。有什么想法吗?
请不要试图建议我在WCF和客户端之间使用服务器端方法(例如,asp.net mvc action cosuming the service),谢谢。
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
<system.serviceModel>
<bindings>
<webHttpBinding>
<binding name="Binding1" />
</webHttpBinding>
</bindings>
<services>
<service name="IServiceForJQuery">
<endpoint behaviorConfiguration="Behavior1"
binding="webHttpBinding" bindingConfiguration="Binding1" name="Endpoint1"
contract="IServiceForJQuery" />
</service>
</services>
<behaviors>
<endpointBehaviors>
<behavior name="Behavior1">
<enableWebScript />
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration>