我需要在我的WCF服务中配置端点。我的服务网址就像。WCF端点配置
http://mysite.com/Services/Service1.svc
我想给客户的URL http://mysite.com/MyService
消费服务。
我在我的web.config
下面试过,但它不工作,当我导航到http://mysite.com/MyService
时,我得到了404错误。
<service name="GateApplication.Services">
<host>
<baseAddresses>
<add baseAddress="http://mysite.com/Services/"/>
</baseAddresses>
</host>
<endpoint
address="http://mysite.com/MyService"
binding="wsHttpBinding"
contract="GateApplication.IService1" >
</endpoint>
</service>
你**主持**你的WCF服务?在IIS里面?如果是这样:那么IIS虚拟目录和'.svc'文件的路径定义了你的服务URL,你不能通过配置 –
@marc_s hello!来改变它!我刚刚开始使用WCF。据我所知,终端用于为消费者提供更加用户友好的URL。除此之外,还有其他任何优势吗?并且我使用的共享主机服务使用IIS.please纠正我,如果我错了 – chamara
端点是外部世界通过与WCF服务对话的连接。但是,当在IIS中托管时,服务URL的命名由IIS决定 - 您不能轻易更改它。 –