Can't Expose Data Contract When Not Used By A Web Service Method

Posted on 2008-11-17
Medium Priority
Last Modified: 2013-12-17
THis drove me crazy for a couple hours. But I have realized that unless I have a method that uses one of my DataContracts as a parameter or a return value, the class is not exposed in the WSDL. So my question is...why the heck not...and can I expose it anyway somehow?
Question by:SGyves
LVL 16

Accepted Solution

ororiole earned 2000 total points
ID: 22980963
Ok, I'll bite: Why would you want to define a datacontract that no one who uses your web service will ever see? Thats the point of a contract, it is exposed to someone else so they can use it.

Web service users can call methods, passing params and getting values back. So if it doesn't fall into one of those catagories WCF figures its not a contract.

"can I expose it anyway somehow?"
I doubt it. I'll check around tho.

Author Closing Comment

ID: 31517680
Okay...problem is...I am mimicing a web service that takes XML as a string and does some serialization\desiralization into these objexts. Unfortunately...I do not have much say in the design on that part. Probably should have just used regular ASP web services eh? But I appreciate you confirming my insanity. Really I do.

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question