This documentation is archived and is not being maintained.
ContractReference::ReadDocument Method
Visual Studio 2008
Reads the service description from the passed Stream and returns the service description.
Assembly: System.Web.Services (in System.Web.Services.dll)
Parameters
- stream
- Type: System.IO::Stream
Stream containing the service description.
Return Value
Type: System::ObjectA ServiceDescription containing the contents of the referenced service description.
int main() { try { // Create the file stream. FileStream^ wsdlStream = gcnew FileStream( "MyService1_cpp.wsdl",FileMode::Open ); ContractReference^ myContractReference = gcnew ContractReference; // Read the service description from the passed stream. ServiceDescription^ myServiceDescription = dynamic_cast<ServiceDescription^>(myContractReference->ReadDocument( wsdlStream )); Console::Write( "Target Namespace for the service description is: {0}", myServiceDescription->TargetNamespace ); wsdlStream->Close(); } catch ( Exception^ e ) { Console::WriteLine( "Exception: {0}", e->Message ); } }
int main() {
try {
// Create the file stream.
FileStream* wsdlStream = new FileStream(S"MyService1_cs.wsdl",
FileMode::Open);
ContractReference* myContractReference = new ContractReference();
// Read the service description from the passed stream.
ServiceDescription* myServiceDescription=
dynamic_cast<ServiceDescription*>(myContractReference->ReadDocument(wsdlStream));
Console::Write(S"Target Namespace for the service description is: {0}",
myServiceDescription->TargetNamespace);
wsdlStream->Close();
} catch (Exception* e) {
Console::WriteLine(S"Exception: {0}", e->Message);
}
}
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: