ContractReference.ReadDocument Method
.NET Framework 2.0
Reads the service description from the passed Stream and returns the service description.
Namespace: System.Web.Services.Discovery
Assembly: System.Web.Services (in system.web.services.dll)
Assembly: System.Web.Services (in system.web.services.dll)
public Object ReadDocument ( Stream stream )
public override function ReadDocument ( stream : Stream ) : Object
Not applicable.
Parameters
- stream
Stream containing the service description.
Return Value
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 ); } }
class MyClass1
{
public static void main(String[] args)
{
try {
// Create the file stream.
FileStream wsdlStream = new FileStream("MyService1_jsl.wsdl",
FileMode.Open);
ContractReference myContractReference = new ContractReference();
// Read the service description from the passed stream.
ServiceDescription myServiceDescription = (ServiceDescription)
myContractReference.ReadDocument(wsdlStream);
Console.Write("Target Namespace for the service description is: "
+ myServiceDescription.get_TargetNamespace());
wsdlStream.Close();
}
catch (System.Exception e) {
Console.WriteLine("Exception: " + e.get_Message());
}
} //main
} //MyClass1
Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.Community Additions
ADD
Show: