Solved

jquery ajax

Posted on 2015-01-22
3
248 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 34

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
add image on html mail 6 27
key press alert 2 32
How to resize a div in html 3 37
Troubles viewing HTML in Outlook 2010 client 3 29
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Find out what you should include to make the best professional email signature for your organization.
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

840 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