Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to expose summary-information or similar to get Intellisense on consumed WCF service?

I have a WCF service where methods are alot like the following. Now, I know that the <summary> info is not exposed, but how can I get that information exposed, so that the consumer gets the information in intellisense?

/// <summary>
/// Obtains a list of agreements for a given dealer
/// </summary>
/// <param name="query">Object identifying the dealer<see cref="AgreementListRequest"/></param>
/// <returns>Object containing a list of all agreements for the provided dealer<see cref="AgreementListResponse"/></returns>
[OperationContract]
[FaultContract(typeof(DatabaseFault))]
[FaultContract(typeof(ServiceAgentFault))]
AgreementListResponse GetAgreements(AgreementListRequest request);
like image 226
Yngve B-Nilsen Avatar asked Feb 04 '11 07:02

Yngve B-Nilsen


People also ask

How to consume the WCF service in client?

With the service running, right click the project that will contain the WCF client proxy and select Add > Service Reference. In the Add Service Reference Dialog, type in the URL to the service you want to call and click the Go button. The dialog will display a list of services available at the address you specify.

How to consume WCF service in c# without adding service Reference?

Right click on the Solution Explorer of "WCFDemo" and go to Add > New Project. In the "New Project" dialog box, under Project types, expand Visual C#, and then click on WCF. Select "WCF Service Application" and in the Name box, type "WCFService". Click "OK".


1 Answers

These code comments only exist in the server - they are comments, and they are .NET specific, so they will not be transported over the wire when you create a client-side proxy for your WCF service.

There's only one way I see that could get you what you want: if you control both ends of the wire, e.g. you write both the service (server) and the client side, you could put your service and data contracts into a separate Contracts assembly, and then share that assembly between the service, and the client-side code. In that case, your client side code would use the exact same file, and thus would have access to the code comments and those would be rendered in intellisense

A second options which I just stumbled over is WCFExtras - a Codeplex project which has some extensions for WCF. The one you could be interested in is the extension that renders your XML code comments on the server side into xsd:documentation tags in the WSDL and back into XML code comments on the client side (when using a .NET client).

Adding WSDL Documentation from Source Code XML Comments
This extension allows you to add WSDL documentation (annotaiton) directly from XML comments in your source file. These comments will be published as part of the WSDL and are available for WSDL tools that know how to take advantage of them (e.g. Apache Axis wsdl2java and others). Release 2.0 also includes a client side WSDL importer that will turn those WSDL comments to XML comments in the generated proxy code.

like image 166
marc_s Avatar answered Sep 22 '22 20:09

marc_s