.net - 无法使用Web Service Studio客户端获取WCF服务的操作列表

标签 .net asp.net web-services wcf

我创建了一个由 ASP.NET 网站托管的简单 WCF 服务:

[ServiceContract]
public interface IPaymentNotificationReceiver
{
    [OperationContract]
    void InvoiceProcessed(string invoiceId);
}   


public class PaymentNotificationReceiver : IPaymentNotificationReceiver
{
    public void InvoiceProcessed(string invoiceId)
    {
        Logger.Write("'InvoiceProcessed' method was called with InvoiceId='" + 
            invoiceId + "'");
    }
}

<system.serviceModel>
  <services>
    <service 
      behaviorConfiguration =
        "NotificationService.PaymentNotificationReceiverBehavior" 
      name="NotificationService.PaymentNotificationReceiver">
      <endpoint address="" binding="wsHttpBinding"
        contract="NotificationService.IPaymentNotificationReceiver">
        <identity>
          <dns value="localhost"/>
        </identity>
      </endpoint>
      <endpoint address="mex" binding="mexHttpBinding" 
          contract="IMetadataExchange"/>
    </service>
  </services>
  <behaviors>
    <serviceBehaviors>
      <behavior name="NotificationService.PaymentNotificationReceiverBehavior">
        <!-- To avoid disclosing metadata information, set the value below 
          to false and remove the metadata endpoint above before deployment 
        -->
        <serviceMetadata httpGetEnabled="true"/>
        <!-- To receive exception details in faults for debugging purposes, 
          set the value below to true.  Set to false before deployment to avoid 
          disclosing exception information -->
        <serviceDebug includeExceptionDetailInFaults="true"/>
      </behavior>
    </serviceBehaviors>
  </behaviors>
</system.serviceModel>

我可以添加对此服务的引用,如 WCF 服务和 WebService。 WcfTestClient 应用程序成功识别服务及其方法。

但是“Web Service Studio”(http://webservicestudio.codeplex.com/) 无法获取操作列表...为什么?如何诊断/解决这个问题?

附注我在 VS 2008 下使用 .NET 3.5 工作

最佳答案

问题出在端点绑定(bind)配置中。要从 WebService 进行访问,它应该是“basicHttpBinding”。

<endpoint address="" 
          binding="basicHttpBinding" 
          contract="NotificationService.IPaymentNotificationReceiver"/>

关于.net - 无法使用Web Service Studio客户端获取WCF服务的操作列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4760353/

相关文章:

c# - 如何在 ASP.NET C# 中将字符串日期转换为 DateTime 形式

wcf - (网站) 上的网页可能暂时关闭,或者可能已永久移至新网址

c# - 秒表耗时线程安全

.net - 如何在 select case 语句中实现 Enum

.net - 当不同命名空间中有两个相似的类时,如何为类设置默认命名空间

c# - 如何调试单个 ASPX 文件?

asp.net - 使用 Find 方法在通用列表中查找对象

c# - Silverlight 中的同步 WebClient 下载

java - 将联网 Java 桌面应用程序迁移到 Web 应用程序有哪些选项

.net - 翻译 WPF