我有一个简单的WCF 4.0服务,其中包含一些简单的方法和一个带有返回List的getter的属性。以编程方式连接时,该服务正常工作。 getter的装饰与接口上定义服务契约的其他方法一样。
我的下一步行动是通过IE网络浏览器访问该服务,以便服务器/部署管理员可以在安装服务后进行“冒烟”。
目前有效:
http://localhost/myservice.svc?wsdl
但是我需要更进一步,让它发挥作用:
http://localhost/myservice.svc/SmokeTest
并且在浏览器中显示结果,SmokeTest是一个带有getter的属性,它会执行填充并返回我想在浏览器中显示的List。
到目前为止,我无法弄清楚我的配置应该是什么样子。所有帮助表示赞赏。
这就是我在web.config中为服务所做的一切。端点是myservice.svc:
<behaviors>
<serviceBehaviors>
<behavior >
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
<services>
<service name="myservice.worker" >
<endpoint address="" binding="basicHttpBinding" contract="myservice.IServicio" />
</service>
</services>