【发布时间】:2018-12-19 02:09:15
【问题描述】:
我在 Angular 中有一个 Web 应用程序,并且我还在这个 Web 应用程序中创建了 WCF 服务。当我运行 Web 应用程序时,URL 是 localhost:53536/#/Page。服务地址为 localhost:53536/Service/Service/svc。我托管了 Web 应用程序,Web 应用程序和 WCF 服务都运行良好。但我想在不同的端口或不同的地址上托管 Web 服务。我怎样才能做到这一点。这是我的 web.config
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="" >
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"
multipleSiteBindingsEnabled="true" />
<bindings>
<wsDualHttpBinding>
<binding name="MobileServiceBinding" closeTimeout="00:00:05" openTimeout="00:00:05">
<readerQuotas maxDepth="32" maxStringContentLength="5242880" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
</binding>
</wsDualHttpBinding>
</bindings>
<services>
<service name="Web.Mobile.MobileService" >
<endpoint address="" binding="wsDualHttpBinding" bindingConfiguration="MobileServiceBinding" contract="Web.Mobile.IMobileService" />
</service>
</services>
</system.serviceModel>
如何为 WCF 服务分配不同的地址?
【问题讨论】: