Hamid
Hamid

Reputation: 129

jquery ajax http 405 or 500 error

i have web service which is using .asmx when i am trying to access using jquery Ajax it is giving me problem of http 405 and some time 500 is it web service problem of client side problem please guide me with example

$j.ajax({
                  type: "POST",
                  //url :'http://Service1.asmx/HelloWorld',
                  url :webServiceUrl,
                  cache:false,
                  async: false,
                  data: soap xml data,
                  dataType :"xml",

                  error:function ()
                  {
                    alert("error");  
                  },
                  contentType:"text/xml; charset=\"utf-8\"",
            }).done(function(response){
                    console.log(response);
                    alert("Yahoo ");

                }); 

        });

Upvotes: 0

Views: 1488

Answers (2)

Liam
Liam

Reputation: 29674

Ok, there is nowhere near enough information to disgnose your problem. But as well as what @MaVRoSCy suggest you could be suffering from the Same origin policy issue.

Basically this says you can't call a web service on www.x.com from www.y.com.

Upvotes: 1

MaVRoSCy
MaVRoSCy

Reputation: 17839

Clearly that is a web server problem.

In the case of error 500, that means that server faces some kind of internal problem.

In case of 405, it means that the web service is not allowing that kind of method. In you case, you are trying to use POST and the server may only be supporting GET requests.

Upvotes: 2

Related Questions