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 1100481
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T00:53:14+00:00 2026-05-17T00:53:14+00:00

I have a service called myService.svc. This service is exposed using a webHttpBinding binding.

  • 0

I have a service called myService.svc. This service is exposed using a webHttpBinding binding. The reason why is because I need to be able to call the service from an iPhone and a JQuery interface as well. From my understanding, WP7 only directly supports BasicHttpBinding which relies on SOAP messages. Unfortunately, SOAP is not directly supported on the iPhone.

My question is, can’t I use a WebClient or HttpWebRequest to interact with a service that uses webHttpBinding. Conceptually I believe it would work, but the implementation is sort of alluding me. I have the following service defined:

[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]
[ServiceBehavior(IncludeExceptionDetailInFaults = false)]
public class myService : ImyService
{
  public MyServiceResult MyMethod(string p1, string p2)
  {
    try
    {
      // Do stuff
      MyResponseObject r = new MyResponseObject();
      r.Property1 = DateTime.Now;
      r.Property2 = "Some other data";
      return r;
    }
    catch (Exception ex)
    {
      return null;
    }
  }
}

[ServiceContract]
public interface ImyService
{
  [OperationContract]
  [WebInvoke(BodyStyle = WebMessageBodyStyle.Wrapped)]
  MyServiceResult MyMethod(string p1, string p2);
}

From my WP7 app, I am using the following code:

string opUrl = "http://localhost:80/services/myService.svc";
Uri myServiceUri = new Uri(opUrl, UriKind.Absolute);

WebClient myServiceClient = new WebClient();
myServiceClient.DownloadStringCompleted += new DownloadStringCompletedEventHandler(myServiceClient_DownloadStringCompleted);
myServiceClient.DownloadStringAsync(myServiceUri);

private void myServiceClient_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
{
  if (e.Result == null)
    MessageBox.Show("null");
  else
    MessageBox.Show(e.Result);
}

When I execute this, e.Result is not null. Rather, a bunch of HTML is returned telling me to use svcutil.exe. My questions are: 1) how do I call this “MyMethod” using webHttpBinding? 2) how do I pass in parameters?

  • 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-17T00:53:15+00:00Added an answer on May 17, 2026 at 12:53 am

    You do not have to use a service binding. You are not tied to SOAP format messages only.

    You can use WebClient and HttpWebRequest.

    Note that only asynchronous requests are supported on the phone though.

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

Sidebar

Related Questions

I have a WCF Service (called myservice.svc) that takes a message from a user
In my activity oncreate method, i have called a service using OnStartCommand(). My requirement
I have created and started windows service Service1 (with exe as MyService.exe) using c#
I have a WCF service (MyService.svc) that im hosting under IIS 7.5. My .svc
Right now I have some class myService extends Service() being called by a startService
I am using service in my program where i have MainActivity.java and MyService.java in
Let's say I have a windows service called MyService and an executable called MyEXE
Let's say I have a windows service called MyService and an executable called MyEXE
I have a nettcpbinding wcf service.It called 100000+ times in one second so there
I have a web service in ASP.NET being called by a time-sensitive process. If

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.