locked
A wcf application when requested sends readystate 0 when calling through sample app in vs2013 RRS feed

  • Question

  • User-265225665 posted

    I have developed a wcf service which is hosted at a central environment, i am able to call and i get success in android, windows app, but while i am calling through a sample web app developed in visual studio 2013 than it respond back with readyState 0.

    Do you guys have any idea about this kind of bug?

    I did all setting related to crossdomainaccess still not getting out of this.

    Thanks

    Wednesday, December 18, 2013 8:01 AM

Answers

  • User-417640953 posted

    Hi k.panchal,

    Thank you post the issue to asp.net forum.

    According to your description, I think you used the javascript ajax to call the wcf service in the web application.

    First of all, we should make sure the wcf service can be called from client side. So we should get the endpointBehaviors like below.

    <endpointBehaviors>
        <behavior name="webScriptEnablingBehavior">
          <enableWebScript/>
        </behavior>
    </endpointBehaviors>
    

    For detail web.config content, please check below article.

    http://msdn.microsoft.com/en-us/library/bb763177(v=vs.90).aspx

    Besides, If we call the wcf cross domain, we also should config the bindings like below.

    <bindings>
            <webHttpBinding>
                <binding name="MyWebHttpBinding" crossDomainScriptAccessEnabled="true"/>
            </webHttpBinding>
    </bindings>
    

    Hope this helps, Thanks.

    Best Regards!

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, December 19, 2013 3:28 AM