Click here to Skip to main content
15,887,336 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have created a REST webservice and hosted it in IIS. My service has a method say "Get(string name)". I can access this method through URL by giving the path of svc file of the WCF Host. But i'm not able to access the same method using the BaseAddress that I have specified in mt web.config file.
Below is my web.config:
HTML
<pre lang="xml"><configuration>
 <system.serviceModel>
        <services>
   <service behaviorConfiguration="ServeBehavior1" name="WCFService.Service">
    <endpoint address="" behaviorConfiguration="EndPointBehavior1"
     binding="webHttpBinding" bindingConfiguration="" name="HttpEndPoint1"
     contract="WCFService.IService" />
    <host>
     <baseAddresses>
      <add baseAddress="http://MachineName/service" />
     </baseAddresses>
    </host>
   </service>
  </services>
  <behaviors>
   <endpointBehaviors>
    <behavior name="EndPointBehavior1">
     <webHttp helpEnabled="true" />
    </behavior>
   </endpointBehaviors>
   <serviceBehaviors>
    <behavior name="ServeBehavior1">
     <serviceMetadata httpGetEnabled="true" />
    </behavior>
   </serviceBehaviors>
  </behaviors>
        <serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>
    </system.serviceModel>
  <system.webServer>
        <modules runAllManagedModulesForAllRequests="true"/>
    </system.webServer>
</configuration>


I'll get the result using the URL: http://localhost:3008/Host/Service.svc/set?name=hi[^]

However, my baseaddress URL: http://MachineName/service/set?name=hi[^] is not working.
Any help is greatly appreciated.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900