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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T05:39:06+00:00 2026-05-16T05:39:06+00:00

In designing my service, I decided that I wanted to customize the namespaces that

  • 0

In designing my service, I decided that I wanted to customize the namespaces that appeared in the resulting WSDL.

For the DataContracts, i came across the ContractNamespace attribute which seemed a nice shortcut alternative to setting the same namespace explicitly for every DataContract. My initial attempt looked like this:

[assembly:ContractNamespace("http://types.mycompany.com/2010/08/03")]
namespace MyCompany.MyContracts
{
    [DataContract]
    //...multiple datacontract classes here
}

To my surprise, this did not work. After much tinkering, I was only successful when I finally set the ClrNamespace property of the attribute equal to my CLR namespace (MyCompany.MyContracts in the example). So something like this

[assembly:ContractNamespace("http://types.mycompany.com/2010/08/03",
          ClrNamespace="MyCompany.MyContracts")]

My question is: why did this not work the first way? My expectation was that by not specifying a CLR namepsace, this attribute would affect all datacontracts assembly-wide.

  • 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-16T05:39:07+00:00Added an answer on May 16, 2026 at 5:39 am

    If I’m not mistaken, if the ClrNamespace is ommitted, then the contract namespace setting applies to objects in the global namespace.

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

Sidebar

Related Questions

i was thinking about designing a service that can provide my subscribers feed updates
I am designing a Proxy Service sequence that includes an XQuery transformation. I have
I am designing a multi-file upload service that also shows upload progress for each
I'm currently designing an app that pulls map data from a service and renders
When designing a web service that will allow the consumer of the service to
I'm designing a comment service that will plug and play with any website that
I am designing the API for a service that deals with Job entities. I
I am designing the API for a client of a service that retrieves data
I am designing a WCF service which have some operations that i expose to
I am designing a REST service that could be used by many types of

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.