Solved

wcf jquery

Posted on 2014-11-11
3
119 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
Comment Utility
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 51

Expert Comment

by:Julian Hansen
Comment Utility
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
Comment Utility
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

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…
Introduction JSON is an acronym for JavaScript Object Notation.  It is a text-string data transport mechanism, capable of representing simple or complex data structures in a consistent and easy-to-read manner.  Similar in concept to XML, but more e…
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…

771 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

10 Experts available now in Live!

Get 1:1 Help Now