我有 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>