Azure Web服务URL问题

时间:2012-01-01 18:03:22

标签: wcf rest azure

我写了一个简单的webget服务,在web.config中添加了这段代码。

然后,为了访问它,我必须输入http://127.0.0.1/service1.svc/data?value=4

我搜索了所有配置文件,但无法找到如何摆脱service1.svc部分..

  <system.serviceModel>
    <behaviors>
      <endpointBehaviors>
        <behavior name="webby">
          <webHttp/>
        </behavior>
      </endpointBehaviors>
      <serviceBehaviors>
        <behavior name="MyServiceTypeBehaviors" >
          <serviceMetadata httpGetEnabled="true" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <services>
      <service name="WCFServiceWebRole1.Service1" behaviorConfiguration="MyServiceTypeBehaviors">
        <endpoint
          address="/"
          binding="webHttpBinding"
          contract="WCFServiceWebRole1.IService1"
          behaviorConfiguration="webby"/>
        <endpoint contract="IMetadataExchange" binding="mexHttpBinding" address="mex" />
      </service>
    </services>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
  </system.serviceModel>

1 个答案:

答案 0 :(得分:1)

如果您使用的是Azure,则很可能是在IIS上托管。

本文:http://social.technet.microsoft.com/wiki/contents/articles/hosting-a-wcf-rest-service-on-iis.aspx很好地解释了如何使用ASP.NET路由将Service1.svc的请求重新路由到您的服务。

相关问题