Click here to Skip to main content
15,891,943 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Following is my code at client and server. Same code working good when deployed on IIS 8.5 in Windows Server 2012. Unable to finding even my IIS directory and resulting 404 error on IIs 7.0 in Server 2008. My request Url:
http://Xx.xx.xx.xx/IISDir/MyRouteService/Home/Attachment


I tried even by simply placing Index.html in IIS(removed all my Service files)
http://Xx.xx.xx.xx/IISDir/Index.html

But no luck same 404 error. Correct me where I'm doing wrong on IIS 7.0


1)Calling WCF Rest service deployed in Test on IIS 7.0.
2)Calling from Desktop application using
HttpWebRequest(Namespace System.Net.Http)

3)Passing Windows credentials using
NetworkCredential credential = new NetworkCredential("Domain/UserName", "pwd");


4) Request should hit service through ServiceRoute in Global.asax at server side
protected void Application_Start(object sender, EventArgs e)
        {
         RouteTable.Routes.Add(new ServiceRoute("MyRouteService", new WebServiceHostFactory(), typeof(Service1)));
        }


5) Service code

 [ServiceContract]
    
    public interface IService1
    {

            [OperationContract]
             [WebInvoke(
                BodyStyle = WebMessageBodyStyle.Bare,
                Method = "POST",
                UriTemplate = "Home/Attachment")]
            Stream HelloRequest(Stream stream);


      }


[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]
    public class Service1 : IService1
    {
        public Stream HelloRequest(Stream stream)
        {
            
        }
    }
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