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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T09:27:05+00:00 2026-05-24T09:27:05+00:00

I am writing a MonoTouch app for iPhone and i am getting the following

  • 0

I am writing a MonoTouch app for iPhone and i am getting the following exception when calling a WCF web service.

Parameter array length does not match the number of message body parts at System.ServiceModel.Dispatcher.WebMessageFormatter+WebClientMessageFormatter.SerializeRequest (System.ServiceModel.Channels.MessageVersion messageVersion, System.Object[] parameters) [0x0003e] in /Developer/MonoTouch/Source/mono/mcs/class/System.ServiceModel.Web/System.ServiceModel.Dispatcher/WebMessageFormatter.cs:310 
  at System.ServiceModel.Description.WebHttpBehavior+ClientPairFormatter.SerializeRequest (System.ServiceModel.Channels.MessageVersion messageVersion, System.Object[] parameters) [0x00000] in /Developer/MonoTouch/Source/mono/mcs/class/System.ServiceModel.Web/System.ServiceModel.Description/WebHttpBehavior.cs:142 
  at System.ServiceModel.MonoInternal.ClientRuntimeChannel.CreateRequest (System.ServiceModel.Dispatcher.ClientOperation op, System.Object[] parameters) [0x0001e] in /Developer/MonoTouch/Source/mono/mcs/class/System.ServiceModel/System.ServiceModel/ClientRuntimeChannel.cs:611 
  at System.ServiceModel.MonoInternal.ClientRuntimeChannel.Request (System.ServiceModel.Description.OperationDescription od, System.Object[] parameters) [0x0002d] in /Developer/MonoTouch/Source/mono/mcs/class/System.ServiceModel/System.ServiceModel/ClientRuntimeChannel.cs:512 
  at System.ServiceModel.MonoInternal.ClientRuntimeChannel.DoProcess (System.Reflection.MethodBase method, System.String operationName, System.Object[] parameters) [0x00038] in /Developer/MonoTouch/Source/mono/mcs/class/System.ServiceModel/System.ServiceModel/ClientRuntimeChannel.cs:482 
  at System.ServiceModel.MonoInternal.ClientRuntimeChannel.Process (System.Reflection.MethodBase method, System.String operationName, System.Object[] parameters) [0x00000] in /Developer/MonoTouch/Source/mono/mcs/class/System.ServiceModel/System.ServiceModel/ClientRuntimeChannel.cs:462 

I am calling the service with the following methods (Some namespaces have been removed for readability):

public void Begin ()
{
    try 
    {
        WebHttpBinding bnd = new WebHttpBinding (WebHttpSecurityMode.Transport);
        bnd.MaxBufferSize=2147483647;
        bnd.MaxReceivedMessageSize=2147483647;
        EndpointAddress addr = new EndpointAddress (new Uri(this.Url));
        ServiceClient service = new ServiceClient (bnd, addr);
        service.Endpoint.Behaviors.Add(new WebHttpBehavior());
        Login login = new Login() 
        { 
            InstitutionId=this.InstitutionNumber.ToString ("D4"), 
            CompanyNumber = (int)this.CompanyId, 
            Password = this.Password, 
            UserName = this.Username 
        };
        LoginRequest loginRequest = new LoginRequest{} (GetClientLoginData(), login);
        service.LoginCompleted += HandleServiceLoginCompleted;
        service.LoginAsync(loginRequest);
    } 
    catch (Exception e) 
    {
        if(failed != null)
        {
            failed(new ErrorInformation(e));
        }
    }
}

void HandleServiceLoginCompleted (object sender, LoginCompletedEventArgs e)
{
    if(e.Cancelled)
    {
        if (failed != null)
        {
            failed (new ErrorInformation ("Request was cancelled"));
        }
    }
    else if(e.Error != null)
    {
        if (failed != null)
        {
            failed (new ErrorInformation (e.Error));
        }
    }
    else
    {
        ServiceClient service =  sender as ServiceClient;
        LoginResponse response = e.Result;
        if (response.LoginResult) 
        {
            if (success != null)
                success ();
        } 
        else 
        {
            if (failed != null)
                failed (new ErrorInformation (response.errmsg));
        }
    }
}

When I run this e.Error in HandleServiceLoginCompleted is not null (it is the above exception). I ran wireshark and no packets are sent to the server at all. The service works correctly when called by other means (such as ASP.NET web pages.) I generated the service reference using silverlight’s slsvcutil.exe.

  • 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-24T09:27:06+00:00Added an answer on May 24, 2026 at 9:27 am

    Set bnd.ReaderQuotas.MaxArrayLength = int.MaxValue
    There are also some other limits that you can increase in ReaderQuotas.

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

Sidebar

Related Questions

Writing a code that does the following: Adds a mouse listener to a web-page
I'm writing an iPhone application using Monotouch and recently the app has started crashing
(I'm Coming from a C# background writing iPhone apps with MonoTouch) I have a
Writing an iPhone app in which I want to save the user the grief
i recently published an iphone app using monotouch to the market. It's currently in
Writing an iPhone app in Objective-C, I have a date in string form (in
Writing a 4-player iPhone game app with programmable mix of human/autoComputer players. After each
I'm writing an app in monotouch which also makes use of a C++ library,
I'm writing an application for the iPhone in MonoTouch, and I have some performance
I'm working on monotouch framework, I'm writing an application for iPhone device, I want

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.