405 Method Not Allowed

I have the javascript function below which is attempting to make a jquery call to a simple .net function.

I am getting:
405 Method Not Allowed

This is my simple .net web service:
Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols

' To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
<System.Web.Script.Services.ScriptService()> _
<WebService(Namespace:="http://tempuri.org/")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Public Class ReportInput
    Inherits System.Web.Services.WebService

    <WebMethod()> _
    Public Function HelloWorld() As String

Can anyone see what I am doing wrong?
function simsFunction() {
	    var settings = {requestType:"soap1.2",
	       error:function(XMLHttpRequest, textStatus, errorThrown){
	       throw XMLHttpRequest.responseText;
		 var oBuffer = new Array();
		 settings.requestType = "soap1.2";
		 settings.methodType = "POST";
		 settings.contentType = "application/soap+xml; charset=utf-8";
		 //settings.url = "http://wsp-sandbox6.co.uk/ReportInput.asmx";
		 settings.url = "http://localhost:2256/CCBCWSTest/ReportInput.asmx/";
		 settings.dataType = "text/xml";
		 settings.nameSpace = "http://tempuri.org/";
		 settings.methodName = "HelloWorld";
		 oBuffer.push('<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/soap/envelope/">');
		  oBuffer.push('<HelloWorld xmlns="http://tempuri.org/" />');      
		 settings.requestData = oBuffer.join("");
		 alert("requestData:" + settings.requestData);
		   type: settings.methodType,
		   cache: false,
		   url: settings.url,
		   data: settings.requestData,
		   contentType: settings.contentType,
		   dataType: settings.dataType,
		   error: function(data,status){    	   	
		   	alert('data = ' + data.d);   	   	
			   success: function(data, testStatus){
			     alert('data = ' + data);	  
			   beforeSend: function(XMLHttpRequest){
			     if (settings.requestType == "soap1.1" || settings.requestType== "soap1.2")
			       XMLHttpRequest.setRequestHeader("SOAPAction",settings.nameSpace + settings.methodName);
			     XMLHttpRequest.setRequestHeader("Connection", "close");

Open in new window

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Try using Get method instead of Post

settings.methodType = "GET";  

instead of

settings.methodType = "POST";

Generally 405 means such kind of request is not allowed. Which may be configured thru IIS.
scm0smlAuthor Commented:
Same error I'm afraid?!
May I know why you are using complexe oBuffer object?

you can simply pass parameters directly to $.ajax function.

Refere this URLs



Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Are you developing the application in VS2005 else higher version.
scm0smlAuthor Commented:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.