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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T02:50:02+00:00 2026-06-03T02:50:02+00:00

I am currently writing a WCF client for a Java web service that is

  • 0

I am currently writing a WCF client for a Java web service that is outside my control. WCF seems to populate the WSA To header with the endpoint address, but this web service requires a different value.

I am currently trying to set the value manually as follows:

var binding = new CustomBinding();
binding.Elements.Add(GetSecurityElement());
binding.Elements.Add
(
    new TextMessageEncodingBindingElement
    (
        MessageVersion.Soap11WSAddressing10,
        Encoding.UTF8
    )
);
binding.Elements.Add(new HttpsTransportBindingElement());

var endpoint = new EndpointAddress
(
    new Uri("endpoint address"),
    new DnsEndpointIdentity("endpoint identity"),
    new AddressHeaderCollection()
);

var client = new Client(binding, endpoint);
client.Open();

using (new OperationContextScope(client.InnerChannel))
{
    OperationContext.Current.OutgoingMessageHeaders.To = new Uri("some other address");
    OperationContext.Current.OutgoingMessageHeaders.MessageId = new UniqueId("message id");
    var response = client.doSomething();
}

Inspecting the request that is generated and sent using Fiddler, I can see that the MessageID header is successfully being set to “message id” rather than the default urn:uuid:[some uuid], but the To header is still being set to “endpoint address” rather than “some other address”.

Is there some other way to overwrite the header value?

  • 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-03T02:50:02+00:00Added an answer on June 3, 2026 at 2:50 am

    I have managd to resolve this using the approach oulined here. In code, the solution was to use :

            var endpoint = new EndpointAddress
            (
                new Uri("wsa to address"),
                new DnsEndpointIdentity("endpoint identity"),
                new AddressHeaderCollection()
            );
    

    To set the value of the WSA To header. Then use:

            client.Endpoint.Behaviors.Add(new ClientViaBehavior(new Uri("address")));
    

    To control the address the request is actually sent to.

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

Sidebar

Related Questions

I'm currently writing a WCF web service that uses LINQ to SQL to fetch
I'm currently writing a web service using WCF in VB.NET. Previous web services I
I'm currently writing a Java app that interfaces with a MySQL database. My problem
lHi, I'm currently writing a WCF service. One of those methods get's a request
I am currently writing the specification for an API that works as follows: Client
I'm writing a client to a WCF service. This is a single app in
I'm writing my first WCF service (as WCF application, that is hosted inside my
thanks for any assistance. I'm creating a wcf web service for an external client.
I'm writing a WCF service to replace a current web service, and I'm having
I have a win forms client that accesses a wcf service for a long

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.