WCF Service 'the resource cannot be found'

Discussion in 'Site Programming, Development and Design' started by sewposhms, Dec 6, 2010.

  1. I've got a silverlight enabled wcf service, but when I moved it over to Winhost and tried to navigate to it to see if it was working I got an error. From other forums I was able to get past a couple errors, but now I'm stuck on this one.

    The resource cannot be found.
    Description: 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. Please review the following URL and make sure that it is spelled correctly.

    All I'm doing is navigating to the URL of the service and when I run the app in debug on my local machine it works fun, so it shouldn't have anything to do with any functions.

    Does anyone have any ideas?
     
    Last edited by a moderator: Oct 14, 2015
  2. Ray

    Ray

    The error you are getting is really not descriptive. Try downloading and installing Fiddler.

    http://www.fiddler2.com/fiddler2/version.asp

    It records all http calls to your application. That should help you better troubleshoot your application.
     
  3. But I'm not having this issue on my local machine. It only happens when I try to do it on Winhost. How would I set Fiddler up to work there?
     
    Last edited by a moderator: Oct 14, 2015
  4. Ray

    Ray

    You don't setup fiddler on our server you set it on your computer. Then go through your web page hosted on our server while running fiddler and it will record the http calls your browser makes to our server and it will give you more details on the error.

    Did you read the link I gave you about fiddler to learn more about it?

    http://www.fiddler2.com/fiddler2/
     
  5. Oh, duh. I hadn't needed Fiddler in over a year, so I forgot how it worked.

    I've been tinkering with it to try to get it working, and now I'm getting a different error. Here's what Fiddler says:

    GET http://sewposhc.w01.Winhost.com/SPService.svc HTTP/1.1
    Accept: image/jpeg, application/x-ms-application, image/gif, application/xaml+xml, image/pjpeg, application/x-ms-xbap, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, */*
    Referer: http://sewposhc.w01.Winhost.com/SPService.svc
    Accept-Language: en-US
    User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; FunWebProducts; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; Tablet PC 2.0)
    Cookie: __utma=119716366.1908115882.1291353020.1291353020.1291437282.2; __utmz=119716366.1291353020.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)
    Accept-Encoding: gzip, deflate
    Proxy-Authorization: Basic bWF0dGhldy5zd2FpbkBtdnRyYW5zaXQuY29tOnRoYXQxZ3V5
    Proxy-Connection: Keep-Alive
    Pragma: no-cache
    Host: sewposhc.w01.Winhost.com
     
    Last edited by a moderator: Oct 14, 2015
  6. Ray

    Ray

    Last edited by a moderator: Oct 14, 2015
  7. Thank you very much. I've got that issue sorted out now. If I put in the URL of the service it all looks good now.

    Unfortunately for some reason I'm still not able to connect my silverlight app to the service.

    I've set up my app to take an init parameter from the page it's hosted in. If I pass it one value then it uses my local service (only accessible from this machine), and if I pass it another then it uses the one I'm hosting on Winhost. When I try to get it to use the one on Winhost though it always fails. Here's the error I get in Fiddler for those service calls:

    I have no idea how to fix that.
     
    Last edited by a moderator: Oct 14, 2015
  8. Ray

    Ray

    Do you have a URL we can look at and see your error message. Sorry but your explaination on how your web application works is a little confusing.
     
  9. Last edited by a moderator: Oct 14, 2015
  10. I've researched the error, and it says I need to include:


    Code:
    <textMessageEncoding messageVersion="None" writeEncoding="utf-8" />
    in my binding in the ServiceReferences.ClientConfig file. Unfortunately that tag is only valid as a child of a custombinding, not a basichttpbinding like I'm using. I guess I can try to change to using a custombinding, but I'm not as familiar with them.
     
  11. Ray

    Ray

    I don't think it is an encoding issue. What is your basichttpbinding look like?
     
  12. I've used each of these bindings:


    <binding name="MyCustomBinding">
    <binaryMessageEncoding />
    <httpTransport maxReceivedMessageSize="2147483647" maxBufferSize="2147483647">
    <extendedProtectionPolicy policyEnforcement="Never" />
    </httpTransport>
    </binding>

    <binding name="MyBasicHttpBinding" maxBufferSize="2147483647"
    maxReceivedMessageSize="2147483647">
    <security mode="None">
    <transport>
    <extendedProtectionPolicy policyEnforcement="Never" />
    </transport>
    </security>
    </binding>

    <binding name="MyOtherCustomBinding">
    <textMessageEncoding writeEncoding="utf-8" />
    <httpTransport maxReceivedMessageSize="2147483647" maxBufferSize="2147483647">
    <extendedProtectionPolicy policyEnforcement="Never" />
    </httpTransport>
    </binding>

    But I can only get the first one to work.
     
  13. Ray

    Ray

    I pulling up your link http://sewposhc.w01.Winhost.com/SewPosh.aspx and fiddler is showing me a lot of 404 error messages. Are you sure you uploaded all the necessary files, components, and assemblies on our web server?
     
    Last edited by a moderator: Oct 14, 2015
  14. I did a publish, and copied everything that was published into there.
     
  15. Ray

    Ray

    You may want to double check again. Also bear in mind that although it maybe working on your local computer it does not necessarily mean that our server will have what ever assembly or component in the servers GAC. Often the case a user takes for granted that what ever they have on their own computer will be on the server also. This is hardly the case. Check your local computer and verify what components or assemblies your application is using and also make sure it is uploaded to your applications Bin folder on the web server.
     
  16. Thank you so much for your help. I finally got it running. It was a service configuration error like I thought, but you pointed me in the right direction.
     
  17. Glad you got it to work! Did you have to upload a .dll, or...?
     

Share This Page