Solved

wcf jquery

Posted on 2014-11-11
3
125 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 52

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

What is a Lightbox? A Lightbox is the effect you see when you click, for example, an image and the screen fades out and up pops the same image but in its full size dimensions. There are lots of Lightbox effects for jQuery. Problem is they are a…
PROBLEM: The other day I was working on adding an ajax request to a webpage that already had a dialog box on the page.  The dialog box was using relative positioning to be positioned next to a form field I had on the page.  Everything was working…
The viewer will learn how to dynamically set the form action using jQuery.
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…

911 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now