Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Complete Tutorial for Cross Domain Compatible Web Service (C#) WITH Accompanying Client Side JavaScript to call it and display the result in an Alert Box in CRM

Posted on by 1,579

I am hoping that someone knows of or can make a very quick and basic step by step tutorial with complete source code that shows:

 

  • A Sample/Basic C# Web Service Compatible with Cross-Domain requests from JavaScript code on a CRM form

 

  • The corresponding Sample/Basic JavaScript Code that goes on the CRM form to call, pass parameters to, and receive data back from the Web Service.

 

I have been unable to find a complete tutorial anywhere that addresses this specific issue.

 

The tutorial shown here would be perfect exactly as written if only its focus was making a cross domain compatible web service along with client side JavaScript without using a proxy web reference since the proxy isn’t possible via CRM front end JavaScript code that’s accessing a web service cross-domain. -- http://www.tutorialspoint.com/asp.net/asp.net_web_services.htm

 

The two attempts to touch the topic via the links below are not complete and neither actually shows or provides a step by step tutorial to create the cross-domain Web Service they are using.

 

http://mscrmshop.blogspot.com/2012/07/crm2011-and-cross-domain-calls-part-1.html

 

http://mscrmshop.blogspot.com/2012/07/crm2011-and-cross-domain-calls-part-2.html

 

Just a simple basic step by step for creating a complete and functional cross domain web service is all I need, with fake data that is hardcoded…and all the JavaScript needs to do it pass it one parameter and then display the result that comes back in an alert. Basic like that is great, I just need something to help get me started…

 

I can make non-cross domain web services all day long… and I can make C# web forms that access them via proxy reference essentially enabling cross-domain access, but that doesn’t help me at all with this specific issue.

 

If anyone can point me to such a tutorial or even make one, that would be a miracle.

*This post is locked for comments

  • Verified answer
    ACECORP Profile Picture
    ACECORP 1,579 on at
    RE: Complete Tutorial for Cross Domain Compatible Web Service (C#) WITH Accompanying Client Side JavaScript to call it and display the result in an Alert Box in CRM

    I ended up writing a complete web service that is JSONP Compliant and the Accompanying JavaScript to call it cross domain.

    The bulk of the code is listed here https://community.dynamics.com/crm/f/117/p/218681/584236#584236 but I will write a tutorial and make it available for everyone soon so that nobody has to endure what I did trying to figure this out.

    Check back soon for a link to the tutorial.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans