locked
wcf, webforms, routing calling drom client RRS feed

  • Question

  • User65893105 posted

    Ive built a website using asp.net 3.5 and webforms.  Ive implmented routing to get seo friendly URLs.  Im now trying to call a WCF method from the clientside using ajax.  On my dev box its working fine, but after uploading it to a hosted environment, its stopped working, I get this error

    NetworkError: 404 Not Found - http://www.livenamehere.co.uk/AudioService.svc/GetAudio?artistId=459&_=1381479348121"


    The service has been uploaded and ive modified the live web.config file to implement wcf


    this is how im calling it


    var webMethod = "http://www.livenamehere.co.uk/AudioService.svc/GetAudio";

    $.ajax({
    cache: false,
    async: true,
    type: "GET",
    dataType: "json",
    url: webMethod,
    data: { artistId: $("#" + '<%= HiddenArtistID.ClientID %>').val() },
    contentType: "application/json;charset=utf-8",
    success: cb,
    error: function (e) { alert(e.statusText); }
    });

    on my dev box I have this and it works fine

    var webMethod = "http://localhost/Website/AudioService.svc/GetAudio";

    can anyone tell me where Im going wrong ?

    Friday, October 11, 2013 4:28 AM

All replies

  • User65893105 posted

    I have a feeling its actually security related, Ive added this to my web.config but it made no difference.  Anyone help ?

    <bindings>
    <wsHttpBinding>
    <binding name="wsSecureBinding">
    <security mode="Transport">
    <transport clientCredentialType="None" />
    </security>
    </binding>
    </wsHttpBinding>
    </bindings>

    Friday, October 11, 2013 4:53 AM
  • User-488622176 posted

    I have some doubts this is security related:

    • Did you publish in the root folder?
    • Did you try without the ".svc" postfix?
    • Did you mark the folder as app folder (enabling the SVC to be invoked) ?
    Friday, October 11, 2013 4:56 AM