OperationInput Sınıf

Tanım

XML Web hizmeti tarafından alınan giriş iletilerinin belirtimlerini tanımlar. Bu sınıf devralınamaz.

C#
public sealed class OperationInput : System.Web.Services.Description.OperationMessage
C#
[System.Web.Services.Configuration.XmlFormatExtensionPoint("Extensions")]
public sealed class OperationInput : System.Web.Services.Description.OperationMessage
Devralma
Devralma
Öznitelikler

Örnekler

C#
using System;
using System.Web.Services.Description;
using System.Collections;
using System.Xml;

class MyOperationInputSample
{
   public static void Main()
   {
      try
      {
         ServiceDescription myDescription =
            ServiceDescription.Read("AddNumbersIn_cs.wsdl");

         // Add the ServiceHttpPost binding.
         Binding myBinding = new Binding();
         myBinding.Name = "ServiceHttpPost";
         XmlQualifiedName myXmlQualifiedName =
            new XmlQualifiedName ("s0:ServiceHttpPost");
         myBinding.Type = myXmlQualifiedName;
         HttpBinding myHttpBinding = new HttpBinding();
         myHttpBinding.Verb = "POST";
         myBinding.Extensions.Add(myHttpBinding);

         // Add the operation name AddNumbers.
         OperationBinding myOperationBinding = new OperationBinding();
         myOperationBinding.Name = "AddNumbers";
         HttpOperationBinding myOperation = new HttpOperationBinding();
         myOperation.Location = "/AddNumbers";
         myOperationBinding.Extensions.Add(myOperation);

         // Add the input binding.
         InputBinding myInput = new InputBinding();
         MimeContentBinding postMimeContentbinding =
           new MimeContentBinding();
         postMimeContentbinding.Type= "application/x-www-form-urlencoded";
         myInput.Extensions.Add(postMimeContentbinding);

         // Add the InputBinding to the OperationBinding.
         myOperationBinding.Input = myInput;

         // Add the ouput binding.
         OutputBinding myOutput = new OutputBinding();
         MimeXmlBinding postMimeXmlBinding = new MimeXmlBinding();
         postMimeXmlBinding.Part= "Body";
         myOutput.Extensions.Add(postMimeXmlBinding);

         // Add the OutputBinding to the OperationBinding.
         myOperationBinding.Output = myOutput;

         myBinding.Operations.Add(myOperationBinding);
         myDescription.Bindings.Add(myBinding);

         // Add the port definition.
         Port postPort = new Port();
         postPort.Name = "ServiceHttpPost";
         postPort.Binding = new XmlQualifiedName("s0:ServiceHttpPost");
         HttpAddressBinding postAddressBinding = new HttpAddressBinding();
         postAddressBinding.Location = "http://localhost/Service.cs.asmx";
         postPort.Extensions.Add(postAddressBinding);
         myDescription.Services[0].Ports.Add(postPort);

         // Add the post port type definition.
         PortType postPortType = new PortType();
         postPortType.Name = "ServiceHttpPost";
         Operation postOperation = new Operation();
         postOperation.Name = "AddNumbers";
         OperationMessage postOutput =
            (OperationMessage)new OperationOutput();
         postOutput.Message =
            new XmlQualifiedName ("s0:AddNumbersHttpPostOut");
         OperationInput postInput = new OperationInput();
         postInput.Message =
            new XmlQualifiedName ("s0:AddNumbersHttpPostIn");

         postOperation.Messages.Add(postInput);
         postOperation.Messages.Add(postOutput);
         postPortType.Operations.Add(postOperation);
         myDescription.PortTypes.Add(postPortType);

         // Add the first message information.
         Message postMessage1 = new Message();
         postMessage1.Name="AddNumbersHttpPostIn";
         MessagePart postMessagePart1 = new MessagePart();
         postMessagePart1.Name = "firstnumber";
         postMessagePart1.Type = new XmlQualifiedName("s:string");

         // Add the second message information.
         MessagePart postMessagePart2 = new MessagePart();
         postMessagePart2.Name = "secondnumber";
         postMessagePart2.Type = new XmlQualifiedName("s:string");
         postMessage1.Parts.Add(postMessagePart1);
         postMessage1.Parts.Add(postMessagePart2);
         Message postMessage2 = new Message();
         postMessage2.Name = "AddNumbersHttpPostOut";

         // Add the third message information.
         MessagePart postMessagePart3 = new MessagePart();
         postMessagePart3.Name = "Body";
         postMessagePart3.Element = new XmlQualifiedName("s0:int");
         postMessage2.Parts.Add(postMessagePart3);

         myDescription.Messages.Add(postMessage1);
         myDescription.Messages.Add(postMessage2);

         // Write the ServiceDescription as a WSDL file.
         myDescription.Write("AddNumbersOut_cs.wsdl");
         Console.WriteLine("WSDL file named AddNumberOut_cs.Wsdl" +
            " created successfully.");
      }
      catch(Exception e)
      {
         Console.WriteLine("Exception caught!!!");
         Console.WriteLine("Source : " + e.Source);
         Console.WriteLine("Message : " + e.Message);
      }
   }
}

Açıklamalar

Bu sınıfın tam olarak bir örneği, üst Operation örneğin özelliğinin bir üyesidirMessages.

sınıfı, OperationInput sırayla öğesinin içine alınmış olan öğenin portType içine alınan operation Web Hizmetleri Açıklama Dili (WSDL) input öğesine karşılık gelir. WSDL hakkında daha fazla bilgi için bkz. WSDL belirtimi.

Oluşturucular

OperationInput()

OperationInput sınıfının yeni bir örneğini başlatır.

Özellikler

Documentation

örneğinin DocumentableItemmetin belgelerini alır veya ayarlar.

(Devralındığı yer: DocumentableItem)
DocumentationElement

için DocumentableItembelge öğesini alır veya ayarlar.

(Devralındığı yer: DocumentableItem)
ExtensibleAttributes

Web Hizmetleri Birlikte Çalışabilirliği (WS-I) Temel Profil 1.1 ile uyumlu olması için WSDL'nin öznitelik uzantılarını temsil eden tür XmlAttribute dizisini alır veya ayarlar.

(Devralındığı yer: DocumentableItem)
Extensions

bu OperationInputile ilişkili öğesini ServiceDescriptionFormatExtensionCollection alır.

Extensions

bu DocumentableItemile ilişkili öğesini ServiceDescriptionFormatExtensionCollection alır.

(Devralındığı yer: DocumentableItem)
Message

İletişime alınan verilerin soyut, yazılan tanımını alır veya ayarlar.

(Devralındığı yer: OperationMessage)
Name

adını OperationMessagealır veya ayarlar.

(Devralındığı yer: OperationMessage)
Namespaces

Bir ServiceDescription nesne oluşturulduğunda ad alanı ön eklerini ve ad alanlarını korumak için kullanılan ad alanı ön eklerinin ve ad alanlarının sözlüğünü alır veya ayarlar.

(Devralındığı yer: DocumentableItem)
Operation

Operation üyesi olduğu OperationMessage öğesini alır.

(Devralındığı yer: OperationMessage)

Yöntemler

Equals(Object)

Belirtilen nesnenin geçerli nesneye eşit olup olmadığını belirler.

(Devralındığı yer: Object)
GetHashCode()

Varsayılan karma işlevi işlevi görür.

(Devralındığı yer: Object)
GetType()

Type Geçerli örneğini alır.

(Devralındığı yer: Object)
MemberwiseClone()

Geçerli Objectöğesinin sığ bir kopyasını oluşturur.

(Devralındığı yer: Object)
ToString()

Geçerli nesneyi temsil eden dizeyi döndürür.

(Devralındığı yer: Object)

Şunlara uygulanır

Ürün Sürümler
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8

Ayrıca bkz.