How call soap service using jQuery

Posted by Alen D on Stack Overflow See other posts from Stack Overflow or by Alen D
Published on 2012-06-23T15:05:52Z Indexed on 2012/06/23 15:16 UTC
Read the original article Hit count: 172

Filed under:
|
|

I have a problem with calling soap service from php page. I was implemented two page,first page was created in php, and second page was created in asp.net. In asp.net application I have SOAP service, which methods should be called from php.

Method on my SOAP service, look like this:

[WebMethod]

[ScriptMethod(ResponseFormat = ResponseFormat.Json)]

public bool UpdateVotes(string vote) {
           //Code 
 }

On PHP application I call UpdateVotes method on the next way:

$.ajax({
                type: "POST",
                url: "http://localhost:5690/VoteServices.asmx/UpdateVotes",
                data: "{'vote': '" + vote + "'}",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (msg) {                   
                },
                error: function (xhr, status, error) {                  
                }
            });

First I run asp.net application with SOAP service, and than I start php aplication.

When i click on button for calling web method on service i browser console i got this error:

Failed to load resource: the server responded with a status of 500 (Internal Server Error) http://localhost:5690/VoteServices.asmx/UpdateVotes
XMLHttpRequest cannot load http://localhost:5690/VoteServices.asmx/UpdateVotes. Origin http://localhost:8080 is not allowed by Access-Control-Allow-Origin.

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about jquery-ajax