English 中文(简体)
WCF 终点例外
原标题:WCF endpoint exception
  • 时间:2010-06-05 13:44:30
  •  标签:
  • wcf

我正与各种世界合作框架(3.0)情景一起尝试。

我是自食其力的。

我正在成为“我的服务图书馆”。 名称号码为零(非基础设施)终端点。 这可能是因为没有为你的申请找到配置文件,或者由于在配置档案中找不到与服务名称相匹配的服务要素,或者由于在服务要素中没有确定终点。

我有一 file(有终点)。

<?xml version="1.0" encoding="utf-8" ?>
<configuration>

  <system.serviceModel>
    <services>

      <service name="Lijo.Samples.NameDecorator"
               behaviorConfiguration="WeatherServiceBehavior">

        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:8010/ServiceModelSamples/FreeServiceWorld"/>
          </baseAddresses>
        </host>

        <endpoint address=""
                  binding="wsHttpBinding"
                  contract="Lijo.Samples.IElementaryService" />
        <endpoint address="mex"
                  binding="mexHttpBinding"
                  contract="IMetadataExchange" />
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="WeatherServiceBehavior">
          <serviceMetadata httpGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="False"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>
</configuration>

并且作为人质

using System.ServiceModel;
using System.ServiceModel.Dispatcher;
using System.ServiceModel.Channels;
using System.ServiceModel.Description;
using System.Runtime.Serialization;

namespace MySelfHostConsoleApp
{
    class Program
    {
        static void Main(string[] args)
        {
            System.ServiceModel.ServiceHost myHost = new ServiceHost(typeof(MyServiceLibrary.NameDecorator));
            myHost.Open(); 
            Console.ReadLine();
        }
    }


}

我的服务如下:

using System.ServiceModel;
using System.Runtime.Serialization;

namespace MyServiceLibrary
{
    [ServiceContract(Namespace = "http://Lijo.Samples")]
    public interface IElementaryService
    {
        [OperationContract]
        CompanyLogo GetLogo();
    }

    public class NameDecorator : IElementaryService
    {
        public CompanyLogo GetLogo()
        {

            CircleType cirlce = new CircleType();
            CompanyLogo logo = new CompanyLogo(cirlce);
            return logo;
        }
    }

    [DataContract]
    public abstract class IShape 
    {
        public abstract string SelfExplain();

    }

    [DataContract(Name = "Circle")]
    public class CircleType : IShape 
    {
        public override string SelfExplain()
        {
            return "I am a Circle";
        }
    }

    [DataContract(Name = "Triangle")]
    public class TriangleType : IShape
    {
        public override string SelfExplain()
        {
            return "I am a Triangle";
        }
    }

    [DataContract]
    [KnownType(typeof(CircleType))]
    [KnownType(typeof(TriangleType))]
    public class CompanyLogo
    {
        private IShape m_shapeOfLogo;

        [DataMember]
        public IShape ShapeOfLogo
        {
            get
            {
                return m_shapeOfLogo;
            }
            set
            {
                m_shapeOfLogo = value;
            }
        }

        public CompanyLogo(IShape shape)
        {
            m_shapeOfLogo = shape;
        }
    }

}

你们能否帮助我了解我在这里失踪的是什么?

增 编

Lijo

最佳回答

你们在ole子里重新自首,你们是如何建立的?

  • 您的<代码>MysolHostConsoleApp项目有app.config file?

  • 页: 1 缩略语 我的自治文献:

错误信息的确意味着无法找到,因此不能加以解释和使用。

<>UPDATE:. 另一种选择是,如果存在,WCF不能解释。

具体如下:

  • 页: 1 NET代码,执行服务的服务类别,称为<代码>。 MyserviceLibrary.NameDecorator

  • 然而,在您的信中,你称职:

    <service name="Lijo.Samples.NameDecorator"
    

不要工作! 你重新组合。 互联网名称空间和这里的服务名称空间,以及你需要列入服务界的名称。 NET完全合格的类型名称(包括网络名称空间——not) 工作名称!

页: 1 以你的法典为基础,但还没有找到。

因此,你需要确保把这两个东西加起来——完全合格的服务类别名称(包括名称和所有名称)MUST与<代码> 名称=”匹配起来。

问题回答

暂无回答




相关问题
WCF DataMember Serializing questions

Ok, so I was part way through the long winded process of creating DTOs for sending my model over the wire and I don t feel like I m going down the right route. My issue is that most of the entities ...

Access WCF service on same server

I have a .NET website with a WCF service. How do I access the current operations context of my service? One possible work around is to just make a call to the service within the app...but that seems ...

WCF binding error

So I got into work early today and got the latest from source control. When I try to launch our ASP.NET application, I get this exception: "The binding at system.serviceModel/bindings/wsHttpBinding ...

The service operation requires a transaction to be flowed

I am facing strange issue with our WCF service. The same code was working fine until recently we added more OperationContracts(Web Methods). We have common 3 tier architecture. DAL (WCF) BLL Web ...

热门标签