1

http://localhost:6272/Service1.svc上没有可以接受消息的端点侦听。这通常是由不正确的地址或 SOAP 操作引起的。有关更多详细信息,请参阅 InnerException(如果存在)。

InnerException 远程服务器返回错误:NotFound

我有 2 个解决方案项目

1. MyApp(Windows 应用程序)

2. WcfService1(类库)

我的网络配置

<?xml version="1.0"?>
<configuration>

 <system.web>
      <compilation debug="true" targetFramework="4.0" />
 </system.web>

<system.serviceModel>

<client>
  <endpoint address="http://localhost:6272/Service1.svc" binding="basicHttpBinding"
    bindingConfiguration="BasicHttpBinding_IService1" contract="ServiceReference1.IService1"
    name="BasicHttpBinding_IService1" />
</client>

<behaviors>
  <serviceBehaviors>
    <behavior>
      <serviceMetadata httpGetEnabled="true"/>
      <serviceDebug includeExceptionDetailInFaults="true"/>
    </behavior>
  </serviceBehaviors>
</behaviors>

<bindings>
  <basicHttpBinding>
    <binding name="BasicHttpBinding_IService1" closeTimeout="00:10:00"
      openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"
      allowCookies="true" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
      maxBufferSize="2147483647" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
      messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
      useDefaultWebProxy="true">
      <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
        maxBytesPerRead="4096" maxNameTableCharCount="16384" />
      <security mode="None">
        <transport clientCredentialType="None" proxyCredentialType="None"
          realm="" />
        <message clientCredentialType="UserName" algorithmSuite="Default" />
      </security>
    </binding>
  </basicHttpBinding>
</bindings>

    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>

 <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
 </system.webServer>

 </configuration>

在我的 Service1.svc.cs 中,我只是将CookiesContainer对象返回给client(MyApp)

我应该怎么办?我的web.config文件有什么变化吗?

4

1 回答 1

0

您的 WcfService1 需要不仅仅是一个类库:您需要以某种方式托管该服务。有许多选项,包括使用 IIS 和自托管。这有点过时,但给出了一个很好的大纲:http: //msdn.microsoft.com/en-us/library/bb332338.aspx

于 2012-09-10T07:08:41.020 回答