WCF服务在localhost上工作,但在服务器上提供端点错误

时间:2012-10-10 12:47:47

标签: c# wcf

我有2个服务和一个测试控制台应用程序来测试它们。

TestConsole2(测试控制台)具有服务RequestsStub的服务引用。 RequestsStub具有对RequestServices的服务引用。

RequestsStub只是从RequestServices调用方法。

如此直观......

TestConsole2 - > RequestsStub - > RequestServices

因此,我在服务器上托管了RequestServices,并将RequestsStub和TestConsole2置于本地。一切都很好。一旦我在服务器上更改了RequestsStub,我就会收到错误....

  

http://urlremoved.on.ca/Requests/RequestService.svc没有可以尝试该消息的端点监听。这通常是由错误的地址或SOAP操作引起的。有关更多详细信息,请参阅InnerException(如果存在)

任何想法或知识都指向我正确的方向?

更新: RequestServices的配置文件......

    <configuration>
  <configSections>
    <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
      <section name="RequestServices.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
    </sectionGroup>
  </configSections>
  <connectionStrings>
    <add name="RequestServices.Properties.Settings.RequestServicesConnectionString"
      connectionString="Data Source=DEVSQL;Initial Catalog=RequestServices;Persist Security Info=True;User ID=webdev;Password=removed"
      providerName="System.Data.SqlClient" />
  </connectionStrings>
  <system.web>
    <compilation debug="true" targetFramework="4.0" />
  </system.web>
  <system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="BasicHttpBinding_ICommunicationService" closeTimeout="00:01:00"
          openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
          allowCookies="false" bypassProxyOnLocal="false" maxBufferPoolSize="524288"
          maxReceivedMessageSize="65536" useDefaultWebProxy="true" />
      </basicHttpBinding>
    </bindings>
    <client>
      <endpoint address="http://urlremoved.on.ca/Communication/CommunicationService.svc"
        binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_ICommunicationService"
        contract="serviceCommunication.ICommunicationService" name="BasicHttpBinding_ICommunicationService" />
    </client>
    <behaviors>
      <endpointBehaviors>
        <behavior name="RequestServices.RequestServiceBehavior">
          <enableWebScript/>
        </behavior>
      </endpointBehaviors>
      <serviceBehaviors>
        <behavior>
          <!-- 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>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
  </system.serviceModel>
 <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
   <httpProtocol>
     <customHeaders>
       <add name="Access-Control-Allow-Origin" value="*" />
     </customHeaders>
   </httpProtocol>
  </system.webServer>

 <applicationSettings>
  <RequestServices.Properties.Settings>
   <setting name="LogSource" serializeAs="String">
    <value>Request Services Service</value>
   </setting>
   <setting name="LogType" serializeAs="String">
    <value>Application</value>
   </setting>
  </RequestServices.Properties.Settings>
 </applicationSettings>


</configuration>

RequestsStub的配置......

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

  <system.web>
    <compilation debug="true" targetFramework="4.0" />
  </system.web>
  <system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="BasicHttpBinding_IRequestService" closeTimeout="00:01:00"
          openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
          allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
          maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
          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>
    <client>
      <endpoint address="http://urlremoved.on.ca/Requests/RequestService.svc"
        binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IRequestService"
        contract="RequestsServiceReference.IRequestService" name="BasicHttpBinding_IRequestService" />
    </client>
    <behaviors>
      <endpointBehaviors>
        <behavior name="RequestsStub.RequestServicesStubBehavior">
          <enableWebScript/>
        </behavior>
      </endpointBehaviors>
      <serviceBehaviors>
        <behavior>
          <!-- 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>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
  </system.serviceModel>
 <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
   <httpProtocol>
     <customHeaders>
       <add name="Access-Control-Allow-Origin" value="*" />
     </customHeaders>
   </httpProtocol>
  </system.webServer>

</configuration>

0 个答案:

没有答案