ContractReference::ReadDocument Method (Stream^)
.NET Framework (current version)
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::Object^A 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 ); } }
.NET Framework
Available since 1.1
Available since 1.1
Show: