Solved

jquery ajax

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article discusses how to create an extensible mechanism for linked drop downs.
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…

679 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