VCFilter.AddWebReference Method

Adds a reference to a Web service to the filter. A new Web service reference subfolder is added to the Web References folder of the project. This new folder contains several other project items related to the Web service. The method returns the ProjectItem object associated with the new Web service folder.

Namespace:  Microsoft.VisualStudio.VCProjectEngine
Assembly:  Microsoft.VisualStudio.VCProjectEngine (in Microsoft.VisualStudio.VCProjectEngine.dll)

Syntax

'Declaration
Function AddWebReference ( _
    bstrUrl As String, _
    bstrName As String _
) As Object
Object AddWebReference(
    string bstrUrl,
    string bstrName
)
Object^ AddWebReference(
    [InAttribute] String^ bstrUrl, 
    [InAttribute] String^ bstrName
)
abstract AddWebReference : 
        bstrUrl:string * 
        bstrName:string -> Object
function AddWebReference(
    bstrUrl : String, 
    bstrName : String
) : Object

Parameters

  • bstrUrl
    Type: System.String

    Required. Typically, this is a file name URL with a .disco or .vsdisco extension.

  • bstrName
    Type: System.String

    Required. Name of the Web service folder.

Return Value

Type: System.Object
A ProjectItem object that is the new Web Reference folder.

Remarks

If the WebReferencesFolder property is Nothing (a null reference), then a ProjectItem for the Web References folder of the project is created and the WebReferencesFolder property is set.

When a Web reference to a Web service is created, a new folder type, ProjectItem, is added to the project's ProjectItems collection. This new ProjectItem contains, in its ProjectItems property, the individual items that make up a Web reference specification. The four types of items included in a Web reference specification are described in the following table.

Item

Purpose

Map file (Reference.map)

This XML file maps URLs to the local cached file location. It lists the discovery file and the service contract files for the Web service.

Service Contract files (.wsdl)

These SOAP files specify the interface of the Web service. There may be more than one contract file in the Web Reference folder.

XML Schema Definition files (.xsd)

These files contain XML schema definitions for the Web service. There may be more than one schema file in the Web Reference folder.

Discovery file (.disco or .vsdisco)

This XML file contains links to other resources that describe the Web service.

.NET Framework Security

See Also

Reference

VCFilter Interface

Microsoft.VisualStudio.VCProjectEngine Namespace