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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T03:06:23+00:00 2026-06-07T03:06:23+00:00

What is the state of Mono for Android’s secure WCF services? Is it up

  • 0

What is the state of Mono for Android’s secure WCF services? Is it up to SOAP 1.2 yet?
I am writing a POC for an Android app that will interact with WCF services, but am struggling to get the thing working.

I am trying to connect to a service that has TransportWithMessageCredential security. However I am getting an error on the server side.

This is the server side error:

MessageSecurityException: Security processor was unable to find a
security header in the message. This might be because the message is
an unsecured fault or because there is a binding mismatch between the
communicating parties. This can occur if the service is configured for
security and the client is not using security.

Server Config:

<service name="BrandDirector.ApplicationServer.Core.Services.UI.Products.Specifications.IngredientService" 
         behaviorConfiguration="CredentialValidation">
    <endpoint address="/BasicHttp"
        binding="basicHttpBinding"
        bindingConfiguration="BDBasicHttpBindingWithSecurity" 
        contract="BrandDirector.ApplicationServer.Core.Services.UI.Products.Specifications.IIngredientService" />
    <endpoint contract="IMetadataExchange" binding="mexHttpBinding" address="mex" />
</service>

<behavior name="CredentialValidation">
  <serviceMetadata httpGetEnabled="true" />
  <serviceDebug includeExceptionDetailInFaults="true" />
  <HttpStatusCode200Behavior />
  <serviceCredentials type="BrandDirector.ApplicationServer.Core.Security.Authentication.PasswordServiceCredentials, BrandDirector.ApplicationServer.Core.Security, Version=1.0.0.0, Culture=neutral">
    <userNameAuthentication userNamePasswordValidationMode="Custom"
      customUserNamePasswordValidatorType="BrandDirector.ApplicationServer.Core.Security.CredentialValidator, BrandDirector.ApplicationServer.Core.Security" />
  </serviceCredentials>
</behavior>

<extensions>
  <behaviorExtensions>
    <add name="HttpStatusCode200Behavior" type="BrandDirector.ApplicationServer.Core.Services.Common.ServiceModel.HttpStatusCode200BehaviorExtension, BrandDirector.ApplicationServer.Core.Services.Common" />
  </behaviorExtensions>

  <basicHttpBinding>
    <binding name="BDBasicHttpBindingWithSecurity" messageEncoding="Text" maxReceivedMessageSize="655536">
      <security mode="TransportWithMessageCredential" >
        <message clientCredentialType="UserName" />
      </security>
    </binding>
  </basicHttpBinding>
</extensions>

Client Code:

public class Activity1 : Activity
{
    private Button button;
    const string address = "https://.../IngredientService.svc/BasicHttp";

    protected override void OnCreate(Bundle bundle)
    {
        base.OnCreate(bundle);


        var timeout = new TimeSpan(0, 1, 0);
        var binding = new BasicHttpBinding(BasicHttpSecurityMode.TransportWithMessageCredential)
        {
            MessageEncoding = WSMessageEncoding.Text,
            Security =
            {
                Transport =
                {
                    ClientCredentialType = HttpClientCredentialType.None,
                    ProxyCredentialType = HttpProxyCredentialType.None
                },
                Message =
                {
                    ClientCredentialType = BasicHttpMessageCredentialType.UserName,
                }
            },
            HostNameComparisonMode = HostNameComparisonMode.StrongWildcard,
            MaxReceivedMessageSize = 655536,
            ReaderQuotas = new System.Xml.XmlDictionaryReaderQuotas
            {
                MaxArrayLength = 655536,
                MaxStringContentLength = 655536,
            },
            SendTimeout = timeout,
            OpenTimeout = timeout,
            ReceiveTimeout = timeout,
        };

        System.Net.ServicePointManager.ServerCertificateValidationCallback += OnServerCertificateValidationCallback;

        // Set our view from the "main" layout resource
        SetContentView(Resource.Layout.Main);

        // Get our button from the layout resource,
        // and attach an event to it
        button = FindViewById<Button>(Resource.Id.MyButton);

        button.Click += delegate
        {
            client = new IngredientServiceClient(binding, new EndpointAddress(address));
            var clientCredential = client.ClientCredentials.UserName;
            clientCredential.UserName = "admin";
            clientCredential.Password = "KDNSG7";

            client.BeginGetIngredients("e", callBack, null);
        };
    }

    IngredientServiceClient client;

    private void callBack(IAsyncResult ar)
    {
        var result = client.EndGetIngredients(ar);

        button.Text = result.First().Name;
    }

    private bool OnServerCertificateValidationCallback(object sender, X509Certificate certificate, 
                                                       X509Chain chain, SslPolicyErrors sslPolicyErrors)
    {
        return true;
    }
}

This code works fine in WPF, the result is returned and all is well. I see from older threads that the WCF is still early in the development cycle, but I just want to check if maybe I am doing something wrong first.

  • 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-06-07T03:06:25+00:00Added an answer on June 7, 2026 at 3:06 am

    I just used RestSharp and a custom authentication header contents that would be authenticated on the server side.

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

Sidebar

Related Questions

I state that i'm not very experienced in android, and I would like to
I state that I am a complete beginner to LDAP. I have to let
Problem: I've written State Machine for my android application. It is separate class, extension
I'm trying acid-state . The documentation states that Update st is an instance of
I'm (re)writing a program that does generic unit test scheduling. The current program is
I'm experimenting for the first time, the Mono framework to develop applications to Android.
My question is virtually identical to mono/linux socket denied? but it doesn't seem that
I am trying to set up a mono asp.net 4.0 test website that uses
I have this state in a work item that can only be set if
Let's consider state machines in VHDL that sit in some idle state until they're

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.