Solved

jquery ajax

Posted on 2015-01-22
3
239 Views
Last Modified: 2015-01-30
http://clientaccesstest.abc.com/wcf/orders/Service.svc?wsdl

I have service like above.  It is working and I can see GetData web service name.

1. However, when I type below, it is not working now?

http://clientaccesstest.abc.com/wcf/orders/Service.svc/GetData

2. For some reasons, I can't see the source codes from the service but I do want to return default value, no matter what it is. Can you show me sample codes in jquery/ajax how to do that?

Thanks
0
Comment
Question by:ITsolutionWizard
3 Comments
 
LVL 44

Expert Comment

by:Rainer Jeschor
ID: 40566295
Hi,
that depends a lot on how the WCF service is implemented.
Normally your jQuery AJAX call is a post (and not a get which is the behaviour when opening the service in the browser).
An good example can be found at the C# Corner site - this handles both sides (service and client):
http://www.c-sharpcorner.com/UploadFile/rohatash/calling-wcf-services-using-jquery/

So are you developing the service? If yes, can you post / attach your source code?

HTH
Rainer
0
 
LVL 33

Expert Comment

by:Slick812
ID: 40567007
Greetings   ITsolutionWizard, , From the web addresses I have used in server side coding , , IF the addy ends in -
         wsdl
then this is a "Web Services Description Language" definition in an XML format, that describes the NameSpaces and the access points (variables, methods) for a sever dispensed SOAP, two-way connection, communication., Since the SOAP transport connection is a very specialized and finicky code method exchange , you almost always need to get EXAMPLE code from the Service providers developers API documentation.
0
 
LVL 22

Accepted Solution

by:
ambience earned 500 total points
ID: 40567026
You haven't explained the nature of errors, but still WSDL means this webservice is SOAP-based and that means regular HTTP/REST/JSON clients would simply not work.

See this jQuery plugin for making SOAP calls to webservices: https://github.com/doedje/jquery.soap

$.soap({
    url: 'http://clientaccesstest.abc.com/wcf/orders/Service.svc',
    method: 'GetData',

...
});

Open in new window


Also keep in mind issues like cross-domain scripting if this service exists in a different domain. Extra work might be needed to enable Cross-domain calls if needed.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

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…
This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
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…

744 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

16 Experts available now in Live!

Get 1:1 Help Now