This documentation is archived and is not being maintained.

ImportCollection.Add Method

Adds the specified Import to the end of the ImportCollection.

[Visual Basic]
Public Function Add( _
   ByVal import As Import _
) As Integer
[C#]
public int Add(
 Import import
);
[C++]
public: int Add(
 Import* import
);
[JScript]
public function Add(
   import : Import
) : int;

Parameters

import
The Import to add to the collection.

Return Value

The zero-based index where the import parameter has been added.

Example

[Visual Basic, C#, C++] The following example shows the use of the Add method. For more information about the CreateImport method used in the sample, see the example under the Import class.

[Visual Basic] 
Dim myServiceDescription As ServiceDescription = _
   ServiceDescription.Read("StockQuote_vb.wsdl")
myServiceDescription.Imports.Add( _
   CreateImport("http://localhost/stockquote/schemas", _
   "http://localhost/stockquote/stockquote_vb.xsd"))

[C#] 
ServiceDescription myServiceDescription = 
   ServiceDescription.Read("StockQuote_cs.wsdl");
myServiceDescription.Imports.Add(
   CreateImport("http://localhost/stockquote/schemas",
   "http://localhost/stockquote/stockquote_cs.xsd"));

[C++] 
ServiceDescription * myServiceDescription = 
   ServiceDescription::Read(S"StockQuote_cpp.wsdl");
myServiceDescription->Imports->Add(
   CreateImport(S"http://localhost/stockquote/schemas", 
   S"http://localhost/stockquote/stockquote_cpp.xsd"));

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

ImportCollection Class | ImportCollection Members | System.Web.Services.Description Namespace

Show: