The resource cannot be found

Discussion in 'Site Programming, Development and Design' started by wsyeager36, Jan 26, 2012.

  1. I have published a WCF 4 .Net web service to my remote website from Visual Studio 2010, but when I try to browse to the svc file via IIS manager, I get "The resource cannot be found" message.

    btw, I want to mention that my web site and service works fine without any issues running both from my local computer, so I know it's some kind of configuration issue.

    I tried both urls below and get the same err msg for both:
    http://yeagerte.w07.Winhost.com/YeagerTechWcfService.svc
    http://yeagerte.w07.Winhost.com/yeagerte/YeagerTechWcfService.svc

    As far as I know, this configuration should work.

    What do I need to do in order to successfully browse to my service using the Winhost servers?

    My web.config file (the pertinent nodes) inside the yeagerte folder (where the service was published) is as follows:
    <services>
    <service name="YeagerTechWcfService.YeagerTechWcfService">
    <endpoint address="" binding="wsHttpBinding" contract="YeagerTechWcfService.IYeagerTechWcfService">
    <identity>
    <dns value="localhost" />
    </identity>
    </endpoint>
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
    <host>
    <baseAddresses>
    <add baseAddress="http://yeagerte.w07.Winhost.com/YeagerTechWcfService.svc/" />
    </baseAddresses>
    </host>
    </service>
    </services>
     
    Last edited by a moderator: Oct 14, 2015
  2. Fiddler data for error.

    I captured the following images from Fiddler. I tried uploading a zip file with other images only 3MB, but it failed to upload.

    Can support please respons ASAP... It just seems to be not the correct url I'm typing in.

    Based on the name of my service:
    • It is published in the "yeagerte" folder on the root of my website.
    • All pertinent dll files are inside the bin directory of this folder.
    • The service name is called YeagerTechService

    What is the exact syntax based on the above for where I should find my web service?

    My pertinent info is as follows. If you need any other info for researching why the error is happening, please klet me know.

    Secondary Web URL:
    yeagerte.w07.Winhost.com

    Site IP Address:
    96.31.35.72
     

    Attached Files:

    Last edited by a moderator: Oct 14, 2015
  3. Elshadriel

    Elshadriel Winhost Staff

    Try marking the /yeagerte folder as an Application Starting Point using the Winhost Control Panel, or it will not read from the .dll files in the /bin folder of that subdirectory. It will look in the /bin folder of the root.
     
  4. Thanks for replying, but I don't see anywhere via the control panel to do what you're asking me...

    Where uis the link in the Control Panel I need to be?
     
  5. OK, I found it and added the starting point (see attached image), but am still getting the same exact error...

    Note that my website resides on the root with a bin directory for the client dlls. I also have the yeagerte folder on the root which contains the dlls for my web service.
    This is very frustrating...

    Please help me set this up correctly...
     

    Attached Files:

  6. Elshadriel

    Elshadriel Winhost Staff

  7. I know MVC... This particular issue has NOTHING to do with routing...

    It's a web service! It is not a VIEW nor a CONTROLLER.

    All I'm trying to do is to simply connect to my web service via an http connection and your Winhost configurations are not allowing me to set up this simple web service correctly.

    As I explained in my previous posts, I have sent you all the info I can on this. You should simply be able to let me know how I can configure connecting to my web service based on the configuration I have on my website.

    Again.... I'm going to remove the starting point I created before, because that is not it.

    I have an MVC web site which has dlls in a bin directory on the root for my client application. My client application communicates with the web service which also exists on my web site, but is in a folder called "yeagerte". Inside this folder resides another bin directory with dlls for the web service.

    According to this setup, what is the proper way I need to configure my website on your servers to communicate with my web service? In other words, how can I access my web service?
     
    Last edited by a moderator: Oct 14, 2015
  8. Since the web service is in the root of the "yeagerte" folder, the proper configuration to connect to the web service should be as follows:

    http://yeagerte.w07.Winhost.com/yeagerte/YeagerTechWcfService.svc/

    I tried this in the web browser and still cannot connect to the service.

    I am getting the same error with more detail in the attached files from Fiddler.

    Please, again... let me know how to properly configure this service so I can connect to it via a browser.

    Contents of app.config file in "yeagerte" folder:
    <services>
    <service name="YeagerTechWcfService.YeagerTechWcfService">
    <endpoint address="" binding="wsHttpBinding" contract="YeagerTechWcfService.IYeagerTechWcfService">
    <identity>
    <dns value="localhost" />
    </identity>
    </endpoint>
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
    <host>
    <baseAddresses>
    <add baseAddress="http://yeagerte.w07.Winhost.com/yeagerte/YeagerTechWcfService.svc/" />
    </baseAddresses>
    </host>
    </service>
     

    Attached Files:

    Last edited by a moderator: Oct 14, 2015
  9. Elshadriel

    Elshadriel Winhost Staff

    Last edited by a moderator: Oct 14, 2015
  10. That didn't resolve the issue...

    My web service resides on the root of my website inside the "yeagerte" folder. I'm wondering if Visual Studio published all the neccessary dll's that I need for the service into its bin directory. Note that I can run this web service fine on my local machine with absolutely no issues, so I know it's some kind of configuration issue.

    Inside the web.config file of my web service, the base address I'm trying to connect to is as follows. This is also the url I'm typing into the browser to hit and cannot be found.
    http://yeagerte.w07.Winhost.com/yeagerte/YeagerTechWcfService.svc/

    The svc file resides inside the "yeagerte" folder and is named simply: YeagerTechWcfService.YeagerTechWcfService.svc

    The name of my website which is hosted is as follows: http://yeagerte.w07.Winhost.com

    What do I need to do in order to get at my svc file via a browser?

    I'm getting the following error via Fiddler:

    <html>
    <head>
    <title>The resource cannot be found.</title>
    <style>
    body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;}
    p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px}
    b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px}
    H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red }
    H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon }
    pre {font-family:"Lucida Console";font-size: .9em}
    .marker {font-weight: bold; color: black;text-decoration: none;}
    .version {color: gray;}
    .error {margin-bottom: 10px;}
    .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }
    </style>
    </head>

    <body bgcolor="white">

    <span><H1>Server Error in '/' Application.<hr width=100% size=1 color=silver></H1>

    <h2> <i>The resource cannot be found.</i> </h2></span>

    <font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif ">

    <b> Description: </b>HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. &nbsp;Please review the following URL and make sure that it is spelled correctly.
    <br><br>

    <b> Requested URL: </b>/yeagerte/YeagerTechWcfService.svc<br><br>

    <hr width=100% size=1 color=silver>

    <b>Version Information:</b>&nbsp;Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272

    </font>

    </body>
    </html>

    [EndpointNotFoundException]: The service '/yeagerte/YeagerTechWcfService.svc' does not exist. at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath)
    at System.ServiceModel.ServiceHostingEnvironment.EnsureServiceAvailableFast(String relativeVirtualPath)
    at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.HandleRequest()
    at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.BeginRequest()
    [HttpException]: The service '/yeagerte/YeagerTechWcfService.svc' does not exist.
    at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
    at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result)
    at System.ServiceModel.Activation.ServiceHttpModule.EndProcessRequest(IAsyncResult ar)
    at System.Web.HttpApplication.AsyncEventExecutionStep.OnAsyncEventCompletion(IAsyncResult ar)
    -->

    I've come across the following threads on the web, but did not resolve the issue:
    http://social.msdn.microsoft.com/Forums/en/wcf/thread/53539d7a-34da-4156-b8d6-f2285b4c260c
    I don't see anywhere to edit the HOST Headers for the website via the IIS 7 Manager or the Winhost Control Panel.
    I also don't see where I can edit the hosts file on your Winhost server. The hosts file exists in the following paths:
    c:\windows\system32\drivers\etc\ or %systemroot%\system32\drivers\etc\​

    http://asp.net.bigresource.com/error-EndpointNotFoundException-The-service-Web-AuthenticationService-svc-does-not-exist-1dS2bgBsC.html

    I manually added the svc file to the ClientBin folder and the problem was "resolved". I tried doing as listed above, but still got the same issues with the following urls:
    http://yeagerte.w07.Winhost.com/yeagerte/YeagerTechWcfService.svc
    http://yeagerte.w07.Winhost.com/YeagerTechWcfService.svc


    The below image are the dlls I have in Visual Studio that are in my bin directory. All of these dll's are in the bin directory of the 'yeagerte' folder (where my web service resides). However, is this all that is needed. If you look at the referenced dll's, all of them are not in the web service bin directory.
     

    Attached Files:

    • dlls.jpg
      dlls.jpg
      File size:
      526.5 KB
      Views:
      508
    Last edited by a moderator: Oct 14, 2015
  11. I even tried the following url which, again, should work based on the file structure that I have in place which leads me again to believe it's still a configuration issue.

    http://yeagerte.w07.Winhost.com/yeagerte/yeagerte/YeagerTechWcfService.svc/

    The above should resolve because I have my svc file inside this exact structure on your hosting service. This is also the base address I have inside the below web.config file.
     

    Attached Files:

    Last edited by a moderator: Oct 14, 2015
  12. Elshadriel

    Elshadriel Winhost Staff

    If you set the directory /yeagerte as an Application Starting Point, it will generate an error message if you browse to http://yeagerte.w07.Winhost.com/yeagerte/YeagerTechWcfService.svc/ saying that you are missing an assembly. This means it's trying to look for the .dll in the /bin folder under the /yeagerte directory. You will need to upload the necessary assemblies to the /bin folder.

    To find out which assemblies you are missing, set the Copy Local property value to true:

    http://msdn.microsoft.com/en-us/library/t1zz5y8c(v=vs.80).aspx

    Recompile your application locally. This will copy the .dll's to the /bin folder in your local development environment. Upload those .dll's using FTP.
     
    Last edited by a moderator: Oct 14, 2015
  13. I copied the YeagerTechWcfService dll from the bin folder of my service to the bin folder of the client (or web) project and it seems to be finding it now, but am getting a binding error:

    "The WSHttpBinding with name WSHttpBinding failed validation because it contains a BindingElement with type System.ServiceModel.Channels.SymmetricSecurityBindingElement which is not supported in partial trust. Consider disabling the message security and reliable session options, using BasicHttpBinding, or hosting your application in a full-trust environment"


    After fixing the above error, now I'm getting another error which I can't find a solution for on the web. Could you help me out here how I can reolve this particular error?

    "Exception Details: System.InvalidOperationException: Access to windows management instrumentation (WMI) is denied. Application may be running in partial trust. Either disable WMI or configure the application to run in full trust."
     
  14. Elshadriel

    Elshadriel Winhost Staff

    Last edited by a moderator: Oct 14, 2015
  15. I kept the wsHttpBinding after putting in the full trust. Success!!!

    Thanks a lot for your dilligence and help :)
     
  16. Elshadriel

    Elshadriel Winhost Staff

    I'm glad we were able to assist you. :)
     

Share This Page