ContractReference.ReadDocument(Stream) Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Lit la description du service à partir du Stream passé et retourne la description du service.
public:
override System::Object ^ ReadDocument(System::IO::Stream ^ stream);
public override object ReadDocument (System.IO.Stream stream);
override this.ReadDocument : System.IO.Stream -> obj
Public Overrides Function ReadDocument (stream As Stream) As Object
Paramètres
Retours
ServiceDescription contenant la description du service référencé.
Exemples
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
{
static void Main()
{
try
{
// Create the file stream.
FileStream wsdlStream = new FileStream("MyService1_cs.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.TargetNamespace);
wsdlStream.Close();
}
catch(Exception e)
{
Console.WriteLine("Exception: "+e.Message);
}
}
}
Class MyClass1
Shared Sub Main()
Try
' Create the file stream.
Dim wsdlStream As _
New FileStream("MyService1_vb.wsdl", FileMode.Open)
Dim myContractReference As New ContractReference()
' Read the service description from the passed stream.
Dim myServiceDescription As ServiceDescription = _
CType(myContractReference.ReadDocument(wsdlStream), _
ServiceDescription)
Console.Write(("Target Namesapce for the service description is: " _
+ myServiceDescription.TargetNamespace))
wsdlStream.Close()
Catch e As Exception
Console.WriteLine(("Exception: " + e.Message))
End Try
End Sub
End Class
S’applique à
Voir aussi
Collaborer avec nous sur GitHub
La source de ce contenu se trouve sur GitHub, où vous pouvez également créer et examiner les problèmes et les demandes de tirage. Pour plus d’informations, consultez notre guide du contributeur.