Solved

wcf jquery

Posted on 2014-11-11
3
127 Views
Last Modified: 2014-11-20
I want to call below service using jquery/ajax.
How can I do that? I am very new to this

Service at http://clientaccesstest.xxx.com/wcf/company/RestService/QuoteServiceJVC/GetDealerShiptoListJSon({COMPANYID},{CUSTOMERNO})
method: get
0
Comment
Question by:ITsolutionWizard
3 Comments
 
LVL 22

Accepted Solution

by:
ambience earned 500 total points
ID: 40436974
Have you tried something like
            $.ajax({
                type: "GET", 
                datatype: "json", 
                url: "http://.....................",
                data: { 'COMPANYID':  '',  'CUSTOMERNO': ''},
                success: function(result) {
                },
                error: function (xhr, ajaxOptions, thrownError) {
                    alert("Error(XHR): " + xhr.status + " - " + thrownError);
                }
            });

Open in new window

This will pass the parameters as regular Query string parameters. However, if you need the exact same URL (somehow) then you can construct the URL differently.
0
 
LVL 55

Expert Comment

by:Julian Hansen
ID: 40437314
If the URL points to a domain other than the one your webpage is downloaded from then the responding server would need to support CORS - otherwise the request will be blocked.
0
 
LVL 4

Expert Comment

by:smeghammer
ID: 40445518
Also, if you have access to your server, then you can write a server-side proxy to call the remote service and call the proxy with your jquery code. This would also avoid cross-domain scripting problems.
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

792 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question