Я создал стандартное приложение службы WCF, размещенное в IIS. В web.config следующий код:Пользовательский сервис/конечная точка адрес
<?xml version="1.0"?>
<configuration>
<appSettings>
<add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
</appSettings>
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5"/>
</system.web>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information, set the values below to false before deployment -->
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="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="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<protocolMapping>
<add binding="basicHttpsBinding" scheme="https" />
</protocolMapping>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
<!--
To browse web app root directory during debugging, set the value below to true.
Set to false before deployment to avoid disclosing web app folder information.
-->
<directoryBrowse enabled="true"/>
</system.webServer>
</configuration>
Теперь я могу просматривать службу в http://localhost:3531/Service1.svc
и конечная точка также имеет один и тот же адрес. Я знаю, что мой базовый адрес теперь http://localhost:3531/Service1.svc
, и я могу установить относительный адрес для конечной точки (например, «MyEndpoint» для http://localhost:3531/Service1.svc/MyEndpoint
).
Но могу ли я изменить служебный адрес на http://localhost:3531/MyService
и адрес конечной точки до http://localhost:3531/MyService/MyEndpoint
?