This documentation is not maintained. Please refer to doc.castsoftware.com/technologies to find the latest updates.

Summary: This document provides basic information about extension providing WCF (Windows Communication Foundation) support for C# and VB.NET.

Extension ID

com.castsoftware.wcf

What's new?

See WCF - 2.0 - Release Notes for more information.

Description

This extension provides support for WCF (Windows Communication Foundation). The calculation of Automated Function Points for your .NET analyses will be supplemented through the creation of new objects and links specific to the WCF framework that will link back to objects/links produced by the base .NET Analyzer.

In what situation should you install this extension?

If your .NET application contains WCF (Windows Communication Foundation) source code and you want to view these object types and their links, then you should install this extension.

WCF framework support

The following WCF frameworks are supported by this extension:

Version

Supported

All versions up to 4.5(tick)

Function Point, Quality and Sizing support

This extension provides the following support:

  • Function Points (transactions): a green tick indicates that OMG Function Point counting and Transaction Risk Index are supported
  • Quality and Sizing: a green tick indicates that CAST can measure size and that a minimum set of Quality Rules exist
Function Points
(transactions)
Quality and Sizing
(tick)(tick)
A Transaction definition is automatically imported when the extension is installed. This definition will be available in the CAST Transaction Configuration Center.

CAST AIP compatibility

This Technology Plug-in is compatible with:

CAST AIP release

Supported

Technology
8.3.x(tick)C# and VB.NET
8.2.x(tick)C# and VB.NET

Supported DBMS servers

This extension is compatible with the following DBMS servers:

DBMSSupported
CSS/PostgreSQL(tick)
Oracle(error)
Microsoft SQL Server(error)

Download and installation instructions

The extension will be automatically downloaded and installed in CAST Console. You can manage the extension using the Application - Extensions interface:

CAST Transaction Configuration Center (TCC) Entry Points

A set of specific Transaction Entry Points are automatically imported when the extension is installed. These Transaction Entry Points will be available in the CAST Transaction Configuration Center:

CAST Transaction Configuration Center (TCC) End Points

A set of specific Transaction End Points are automatically imported when the extension is installed. These Transaction End Points will be available in the CAST Transaction Configuration Center:

What results can you expect?

Once the analysis/snapshot generation has completed, you can view the results in the normal manner. The following objects and links will be displayed in CAST Enlighten:

Objects

IconDescription

WCF Configuration

WCF Client Endpoint

WCF Service Endpoint

WCF Operation Contract

WCF Service Contract

WCF Service

WCF Operation Method Delete

WCF Operation Method Get

WCF Operation Method Post

WCF Operation Method Put

WCF Post Resource Service

WCF Data Contract

Configuration objects

Configuration objects are mapped on the Web.config or App.config file available in the csharp project:

<configuration>
  <system.serviceModel>
    <services>
		<service name="TrailService.Service2">
			 <endpoint address="http://localhost:59364/Service2.svc/Service2WebConfig" binding="basicHttpBinding" bindingConfiguration="HttpBinding" contract="TrailService.IService2"></endpoint>
			<host>
				<baseAddresses>
					<add baseAddress="http://localhost:59364/Service2.svc/Service2WebConfig" />
				</baseAddresses>
			</host>

		</service>
      <service name="TrailService.CalculatorService">
        <endpoint address="CalculatorService" binding="basicHttpBinding" bindingConfiguration="HttpBinding" contract="TrailService.ICalculator"></endpoint>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:59365/Service1.svc/" />
				<add baseAddress="http://localhost:59365/Service1.svc/dummy" />
          </baseAddresses>
        </host>
      </service>
    </services>
	  <client>
		  <endpoint address="http://localhost:59363/ClientService/ClientService"
				binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IClientService"
				contract="IClientService" name="BasicHttpBinding_IClientService" />
	  </client>
  </system.serviceModel>
</configuration>

Operation objects

The following .NET code is supported:

[ServiceContract(Namespace = "http://Microsoft.ServiceModel.Samples")]
public interface ICalculator
{
	[OperationContract]
	double Add(double arg1, double arg2);
	[OperationContract]
	double Sub(double arg1, double arg2);
	[OperationContract]
	double Mul(double arg1, double arg2);
	[OperationContract]
	double Div(double arg1, double arg2);
}

Four "WCF Operation Contract" operations are created with urls constructed from interface namespace, interface name and method names.

    [ServiceContract]
    public interface IRestServiceImpl
    {
        [OperationContract]
        [WebInvoke(Method = "PUT", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped, UriTemplate = "todos/{id}")]
        void UpdateTodos(string id);
	}

A "WCF Operation PUT" operation is created from UriTemplate parameter:

  • todos/{id}
    [ServiceContract]
    public interface IRestServiceImpl
    {
        [WebGet(UriTemplate = "/todos")]
        void GetTodos();
	}

A "WCF Operation GET" operation is created from UriTemplate parameter:

  • todos

Resource service objects

The following .NET code is supported:

    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    [System.ServiceModel.ServiceContractAttribute(Namespace="http://Microsoft.ServiceModel.Samples", ConfigurationName="ServiceReferenceTrailService.ICalculator")]
    public interface ICalculator {
        
        [System.ServiceModel.OperationContractAttribute(Action="http://Microsoft.ServiceModel.Samples/ICalculator/Add", ReplyAction="http://Microsoft.ServiceModel.Samples/ICalculator/AddResponse")]
        double Add(double arg1, double arg2);
        
        [System.ServiceModel.OperationContractAttribute(Action="http://Microsoft.ServiceModel.Samples/ICalculator/Sub", ReplyAction="http://Microsoft.ServiceModel.Samples/ICalculator/SubResponse")]
        double Sub(double arg1, double arg2);
        
        [System.ServiceModel.OperationContractAttribute(Action="http://Microsoft.ServiceModel.Samples/ICalculator/Mul", ReplyAction="http://Microsoft.ServiceModel.Samples/ICalculator/MulResponse")]
        double Mul(double arg1, double arg2);
        
        [System.ServiceModel.OperationContractAttribute(Action="http://Microsoft.ServiceModel.Samples/ICalculator/Div", ReplyAction="http://Microsoft.ServiceModel.Samples/ICalculator/DivResponse")]
        double Div(double arg1, double arg2);
    }

Four "WCF POST resource service" resource services are created with urls constructed from "Action" OperationContractAttribute parameter.

Data contract object

    [Serializable]
    [DataContract(Namespace = "")]
    public class AddressDetails
    {
        [DataMember]
        public string Street1 { get; set; }

        [DataMember]
        public string City { get; set; }

        [DataMember]
        public string Country { get; set; }

        [DataMember]
        public string PostalCode { get; set; }

    }

Links from WCF and .NET objects to the configuration objects where they are referenced

SourceLink typeTargetExample
.NET Interface or classreferLinkWCF Service Endpoint

WCF OperationreferLinkWCF Service Endpoint

.NET Interface or classreferLinkWCF Client Endpoint

Links around WCF operations and resources

All links are "callLink" type.

  • from the .NET method to the WCF resource service corresponding to the method.
  • from the WCF operation to the .NET method corresponding to the operation.
  • from the WCF resource service to the WCF operation. This last link is created by the "web service linker" extension comparing the urls which are matching.

Links around WCF Data Contract

Links are:

  • accessWriteLink from the .NET class constructor to the WCF Data contract object.
  • accessReadLink from each .NET getter of each property of the class to the WCF Data contract object.
  • accessWriteLink from each .NET setter of each property of the class to the WCF Data contract object.

If a property has no getter or setter:

  • accessReadLink from the property to the WCF Data contract object.

Structural rules

The following structural rules are provided:

Limitations

In this section we list the most significant functional limitations that may affect the analysis of applications using WCF:

  • If the configuration of WCF service is done through the code (endpoint configuration, service creation), this is not supported.
  • Concerning rules about configuration, violations are reported only if violations are in configuration files or in CSharp code, but not in VB code.