WCF服务未显示方法和变量

时间:2015-12-24 05:20:08

标签: c# wcf wsdl

我已经编写了WCF服务并在IIS上发布。当我尝试使用?wsdl 访问WCF服务的wsdl时,它没有显示我在WCF服务中声明的方法名称。但是如果我使用?wsdl = wsdl0 ,它会显示方法定义和所有其他数据。为什么呢?

此外,我已经尝试了其他可能重复的线程中提供的几乎所有建议,但这对我不起作用。

接口类:

[System.ServiceModel.ServiceContract(Namespace = "urn:x.ServiceContracts",  Name = "xService", SessionMode = System.ServiceModel.SessionMode.Allowed, ProtectionLevel = ProtectionLevel.None)]
public partial interface IService
{
    [OperationContract(IsTerminating = false, IsInitiating = true, IsOneWay = false, AsyncPattern = false, Action = "Insert", ProtectionLevel = ProtectionLevel.None)]
    string[] Insert(string name);

在配置文件中,我在下面添加了公开方法,但它仍然不适合我。

<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />

谁能告诉我我错过了什么?

0 个答案:

没有答案