Calling WCF sample service from my webpage RRS feed

  • Question

  • I posted this question on the Visual Studio Developer Center >.NET Framework Forums > Windows Communication Foundation, Serialization, and Networking forum, but have had no response.  Is there a better forum for this question

    JSONP sample - JsonpAjaxService is not defined

    I am trying to call the Jsonp example from my website (c:\WR-WCF-Samples\WCF\Basic\Ajax\JSONP).

    Firebug indicates that I have a

    ReferenceError: JsonpAjaxService is not defined
    var proxy= new JsonpAjaxService.CustomerService();

    I placed the script and body from JSONPClientPage.aspx into my webpage, changing the ServiceReference Path to

                <asp:ServiceReference Path="h_ttp:/_/" />

    I added service and behavior definitions to Web.Config:

          <service name=" JsonpAjaxService" behaviorConfiguration="MyServiceBehavior">
            <endpoint address=""
              behaviorConfiguration="web" />

            <behavior name="MyServiceBehavior">
              <serviceMetadata httpGetEnabled="true"/>
              <serviceDebug includeExceptionDetailInFaults="true" />
            <behavior name="web">
              <webHttp />

    I built the solution in Visual Studio 2012 and then published the service to IIS.

    I assume that this is a Service/IIS/Website configuration issue, but I don't know what to change.  How does my webpage connect to JsonpAjaxService?

    Thanks so much for your help!

    Monday, May 6, 2013 7:13 PM