The error message "This virtual context context URL is not valid" indicates that there is an issue with the URL that you are using to call the WebMethod. Make sure that the URL is correct and that the WebMethod is accessible from the client-side.
Regarding the "Authentication failed" error when using AJAX, ensure that authentication is properly set up on the server-side and that the AJAX request includes the necessary authentication credentials.
You could also try enabling CORS (Cross-Origin Resource Sharing) on the server-side to allow cross-domain requests. Additionally, check the server-side logs for any relevant error messages or exceptions.