jsonp wcf cross domain

i have been struggled in wcf cross domain issue using jquery/ajax.
someone told me jsonp may be able to resolve the issue.
Can you show me how to enable wcf with jsonp?
and more importantly how to call jsonp?
LVL 1
ITsolutionWizardAsked:
Who is Participating?
 
Rainer JeschorCommented:
Hi,
this is one of the better technical explanation posts:
http://www.codeproject.com/Articles/259832/Consuming-Cross-Domain-WCF-REST-Services-with-jQue

In general there are two important things:
1. WCF service web.config
This has to have the cross domain enabled:
<webHttpBinding>
                <binding name="webHttpBindingWithJsonP"
                         crossDomainScriptAccessEnabled="true" />
            </webHttpBinding>

Open in new window


2. jQuery JSONP
This is just setting the correct property of the $.ajax call:
dataType: "jsonp"

Open in new window


HTH
Rainer
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.