0

I've spent a week trying to use http://monitoring-gps.com.ua/aspservices/asptest.asmx methods on client side. How to do that?

4 Answers 4

1

You can use jquery to do this -- look at http://encosia.com/2008/03/27/using-jquery-to-consume-aspnet-json-web-services/

Sign up to request clarification or add additional context in comments.

Comments

1

Use Ajax + Jquery: http://api.jquery.com/jQuery.ajax/

$.ajax( {
                                    type: "POST",
                                    contentType: "application/json; charset=utf-8",
                                    dataType: "json",
                                    url: "http://monitoring-gps.com.ua/aspservices/asptest.asmx/METHODNAME",                                                            
                                    data: "{'paramName':'" + ParamValue + "'}",
                                    success: function(data) { alert("That works;") }  
                                });

1 Comment

$.ajax( { type: "POST", contentType: "application/json; charset=utf-8", dataType: "json", url: "monitoring-gps.com.ua/aspservices/asptest.asmx/DeviceList", data: "{}", success: function(data) { alert("That works;") } }); Maybe I did something wrong?
0

There are a few options here:

  1. Make a web reference using visual studio and then you can access it via javascript after you put a script service reference in the .aspx page http://msdn.microsoft.com/en-us/magazine/cc163499.aspx

  2. Use JQuery to make a ajax call. http://api.jquery.com/jQuery.ajax/

Comments

0

As far as I know, you can't call a cross domain web service via java script. If you try to call a web service within your web application in javascript, it will work. You need to find some workaround . This link should be helpful http://www.simple-talk.com/dotnet/asp.net/calling-cross-domain-web-services-in-ajax

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.