Solved

wcf jquery

Posted on 2014-11-11
3
126 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 54

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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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…

777 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