本文介绍了无法获取WCF服务的操作与Web服务Studio客户名单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建由ASP.NET网站举办一个简单的WCF服务:

I've created a simple WCF service hosted by ASP.NET web site:

[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申请成功识别服务及其方法。

I can add references to this service as to WCF service, as to WebService.WcfTestClient application successfully recognized service and its methods.

但是,Web服务工作室(HTTP://webservicestudio.$c$cplex.com/)无法获取操作的列表...为什么?如何诊断/解决?

But "Web Service Studio" (http://webservicestudio.codeplex.com/) can't get a list of operations... Why? How to diagnose/resolve that?

P.S。我在VS 2008下工作,使用.NET 3.5

P.S. I work under VS 2008 using .NET 3.5

推荐答案

这个问题在终端绑定配置。为了从WebService的访问应该是basicHttpBinding的。

The problem was in endpoint binding configuration. To be accessible from WebService it should be 'basicHttpBinding'.

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

这篇关于无法获取WCF服务的操作与Web服务Studio客户名单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-02 11:15