loviji
loviji

Reputation: 13080

Where physically save WebService files in asp.net website?

What you prefer about saving Webservice files in asp.net website(not websiteapplication). I saved WebService files in App_Code\WS\somewebservice.asmx.cs.

And call method from this class with jquery.ajax

     $("#btnMY").click(function() {
            $.ajax({
                type: "POST",
                url: "App_Code/WS/ConstructorWS.asmx/HelloWorld",
                data: "{}",
                contentType:"application/json; charset=utf-8",
                dataType:"jsondata",
                success: function(msg) {
                }
            });
        });

But firebug show error 403 Forbidden

Upvotes: 1

Views: 745

Answers (1)

M4N
M4N

Reputation: 96571

I guess it's not possible to access files inside the App_Code folder. Try moving your web service to a different place (e.g. ~/WS/) instead.

If you want, you can put the *.asmx file there and keep the *.asmx.cs files inside App_Code. In that case you need to edit the source of the *.asmx file and adjust the path to the *.cs file.

Upvotes: 2

Related Questions