按照模板添加一个名为Services1的服务
Web.config配置注意以下两点
<serviceBehaviors>
<behavior name="MyServiceTypeBehaviors" >
<serviceMetadata httpGetEnabled="true" />
</behavior>
</serviceBehaviors>
<services> <service name="JSStudy.JQuery.Chapter6AJax.Service1" behaviorConfiguration="MyServiceTypeBehaviors"> <endpoint address="" behaviorConfiguration="JSStudy.JQuery.Chapter6AJax.Service1AspNetAjaxBehavior" binding="webHttpBinding" contract="JSStudy.JQuery.Chapter6AJax.Service1" /> </service> </services>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"
multipleSiteBindingsEnabled="true">
<serviceActivations>
<add relativeAddress="Service1.svc" service="Service1" factory="System.ServiceModel.Activation.WebScriptServiceHostFactory" />
</serviceActivations>
</serviceHostingEnvironment>