Click here to Skip to main content
15,893,594 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
What I'd like to do is consume WCF using javascript on the client side. I have been able to do this using ASP.NET but haven't found any solution to do the same using javascript. Browsing for a solution for days on end hasn't really helped either. Any help would be really helpful.
Posted

1 solution

 
Share this answer
 
Comments
wShaiza 22-Jun-13 2:05am    
Hello Zafar,

I appreciate your help. But the link doesn't exactly relate to the issue that I have. In the solution explained in the link, the JavaScript seems to have been auto-generated. What I want to do is write the code on the client side using Javascript which would then call the WCF. So basically, there would be two projects within the same solution.

Btw, I am able to call the WCF if the Javascript is also in the same project. Here's the code that I use to do that,( just in case it helps make my point more clear):

$.ajax({
type: "POST",

url: "Service1.svc/functionName",

contentType: "application/json;charset=utf-8", // content type sent to server
dataType:"json",
success: ServiceSucceeded,
error: ServiceFailed
});

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900