You must Sign In to post a response.
  • Category: WCF

    IIS 7.0 error 404 Directory Not found WCF Deployment

    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
    Hide Copy Code
    NetworkCredential credential = new NetworkCredential("Domain/UserName", "pwd");

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

    5) Service code

    Hide Copy 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)
    {

    }
    }
  • #762976
    Hi

    Once open IIS(Internet Information services) and add your website to IIS, right click on your website and select edit permissions go to security tab and give permissions to the user you are working with or else you can go with add and find user.
    If not solved go to IIS and select ISAPI and CGI restrictions and see the options it is allowed or not allowed.

    Sridhar Thota.
    Editor: DNS Forum.

  • #762984
    Seems you did not add the mapping for the SVC extension to ASP.NET.
    you will be able to add this by running ServiceModelReg.exe -i from C:\Windows\Microsoft.NET\Framework\v3.0\Windows Communication Foundation.
    Also make sure to enable ASP.NET if you haven't already done so.


    Regards,
    Asheej T K


  • Sign In to post your comments