Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1093625
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T23:51:10+00:00 2026-05-16T23:51:10+00:00

I have an existing ASP.NET web application. This ASP.NET web application uses JQuery to

  • 0

I have an existing ASP.NET web application. This ASP.NET web application uses JQuery to provide a rich experience to the users. This user interface interacts with the server through some WCF services. A sample service looks like the following:

[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]
[ServiceBehavior(IncludeExceptionDetailInFaults = false)]
public class myService : ImyService
{
  public bool SomeMethod(string parameter1, string parameter2)
  {
    try
    {
      return true;
    }
    catch (Exception ex)
    {
      return false;
    }
  }
}

I now want to expose this service to an iPhone and a Windows Phone 7 application. In an attempt to do this, I have configured the service like the following:

<system.serviceModel>      
  <behaviors>
    <endpointBehaviors>
      <behavior name="myServiceBehavior">
        <enableWebScript />
      </behavior>
    </endpointBehaviors>
    <serviceBehaviors>
      <behavior name="">
        <serviceMetadata httpGetEnabled="true" />
        <serviceDebug includeExceptionDetailInFaults="false" />
      </behavior>
    </serviceBehaviors>
  </behaviors>

  <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
  <services>
    <service name="myService">
      <endpoint address="" behaviorConfiguration="myServiceBehavior"
        binding="webHttpBinding" contract="ImyService" />
    </service>
  </services>
</system.serviceModel>

The service works with the JQuery calls in my ASP.NET web application. I have not begun working on the iPhone client. But, when I try to expose this service to my WP7 client, I run into problems. As it stands now, when I launch my WP7 application, I receive an error that says:

KeyNotFoundException

If I change the binding in the config file to “basicHttpBinding”, I cannot reference the service in Visual Studio. I receive an error that says:

The endpoint at 'http://machine:80/services/myService.svc' does not have a Binding with the None MessageVersion.  'System.ServiceModel.Description.WebScriptEnablingBehavior' is only intended for use with WebHttpBinding or similar bindings.

Ugh. How do I move forward? I thought WCF was designed to make this stuff easier. But I feel like I’m getting stuck doing something relatively basic.

Thank you for your help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T23:51:11+00:00Added an answer on May 16, 2026 at 11:51 pm

    As far as I know (but I have no experience at all with iPhone or WinPhone development) you should be able to expose your WCF service using the regular webHttpBinding and no web script functionality, to get a normal REST style WCF service:

    <system.serviceModel>      
       <services>
          <service name="myService">
             <endpoint 
                 address="" 
                 binding="webHttpBinding" 
                 contract="ImyService" />
          </service>
       </services>
    </system.serviceModel>
    

    That alone should be sufficient – just browse to the virtual directory where your *.svc file is located and you should see your top-level resources in your browser.

    The mobile devices typically don’t support the SOAP-style bindings (like basicHttpBinding and so on) – so you need to use webHttpBinding instead (since that really only requires an HTTP client stack on the device – and every device these days definitely has this!)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.