12,162
社区成员
发帖
与我相关
我的任务
分享
<configuration>
<system.serviceModel>
<services>
<service name="LearnWCF.HelloWCFService" behaviorConfiguration="metadataExchange">
<endpoint address="" binding="wsHttpBinding" contract="LearnWCF.IHelloWCF"/>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="metadataExchange">
<serviceMetadata httpGetEnabled="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>
using System;
using System.ServiceModel;
namespace LearnWCF
{
[ServiceContract]
public interface IHelloWCF
{
[OperationContract]
string HelloWCF();
}
public class HelloWCFService : IHelloWCF
{
public string HelloWCF()
{
return "Hello WCF!";
}
}
}
<%@ ServiceHost language=c# Debug="true" Service="LearnWCF.HelloWCFService" %>