共用方式為


Operation.ParameterOrderString 屬性

定義

取得或設定選擇性遠端程序呼叫 (Remote Procedure Call,RPC) 簽章,它會為要求 - 回應或請求 - 回應作業排序規格。

public:
 property System::String ^ ParameterOrderString { System::String ^ get(); void set(System::String ^ value); };
public string ParameterOrderString { get; set; }
member this.ParameterOrderString : string with get, set
Public Property ParameterOrderString As String

屬性值

MessagePart 執行個體的名稱清單,以單一空格分隔。

範例

String^ myString = nullptr;
Operation^ myOperation = gcnew Operation;
myDescription = ServiceDescription::Read( "Operation_2_Input_CS.wsdl" );
array<Message^>^myMessage = gcnew array<Message^>(myDescription->Messages->Count);

// Copy the messages from the service description.
myDescription->Messages->CopyTo( myMessage, 0 );
for ( int i = 0; i < myDescription->Messages->Count; i++ )
{
   array<MessagePart^>^myMessagePart = gcnew array<MessagePart^>(myMessage[ i ]->Parts->Count);

   // Copy the message parts into a MessagePart.
   myMessage[ i ]->Parts->CopyTo( myMessagePart, 0 );
   for ( int j = 0; j < myMessage[ i ]->Parts->Count; j++ )
   {
      myString = String::Concat( myString, myMessagePart[ j ]->Name, " " );
   }
}

// message part names.
myOperation->ParameterOrderString = myString;
array<String^>^myString1 = myOperation->ParameterOrder;
int k = 0;
Console::WriteLine( "The list of message part names is as follows:" );
while ( k < 5 )
{
   Console::WriteLine( myString1[ k ] );
   k++;
}
string myString = null ;
Operation myOperation = new Operation();
myDescription = ServiceDescription.Read("Operation_2_Input_CS.wsdl");
Message[] myMessage = new Message[ myDescription.Messages.Count ] ;

// Copy the messages from the service description.
myDescription.Messages.CopyTo( myMessage, 0 );
for( int i = 0 ; i < myDescription.Messages.Count; i++ )
{
   MessagePart[] myMessagePart =
      new MessagePart[ myMessage[i].Parts.Count ];

   // Copy the message parts into a MessagePart.
   myMessage[i].Parts.CopyTo( myMessagePart, 0 );
   for( int j = 0 ; j < myMessage[i].Parts.Count; j++ )
   {
      myString += myMessagePart[j].Name;
      myString += " " ;
   }
}
// Set the ParameterOrderString equal to the list of
// message part names.
myOperation.ParameterOrderString = myString;
string[] myString1 = myOperation.ParameterOrder;
int k = 0 ;
Console.WriteLine("The list of message part names is as follows:");
while( k<5 )
{
   Console.WriteLine( myString1[k] );
   k++;
}
Dim myString As String = Nothing
Dim myOperation As New Operation()
myDescription = ServiceDescription.Read("Operation_2_Input_VB.wsdl")
Dim myMessage(myDescription.Messages.Count) As Message

' Copy the messages from the service description.
myDescription.Messages.CopyTo(myMessage, 0)
Dim i As Integer
For i = 0 To myDescription.Messages.Count - 1
   Dim myMessagePart(myMessage(i).Parts.Count) As MessagePart

   ' Copy the message parts into a MessagePart.
   myMessage(i).Parts.CopyTo(myMessagePart, 0)
   Dim j As Integer
   For j = 0 To (myMessage(i).Parts.Count) - 1
      myString += myMessagePart(j).Name
      myString += " "
   Next j
Next i

' Set the ParameterOrderString equal to the list of 
' message part names.
myOperation.ParameterOrderString = myString
Dim myString1 As String() = myOperation.ParameterOrder
Dim k As Integer = 0
Console.WriteLine("The list of message part names is as follows:")
While k < 5
   Console.WriteLine(myString1(k))
   k += 1
End While

備註

具名 MessagePart 實例必須遵守下列規則:

  • 具名 MessagePart 實例的順序會反映 RPC (遠端程序呼叫) 簽章中的參數順序,也就是作業的名稱、其輸入和輸出參數、傳回的結果,以及可能會要求處理的例外狀況。

  • 傳回值不存在於清單中。

  • MessagePart如果名稱同時出現在輸入和輸出訊息中,則為 in/out 參數。

  • MessagePart如果名稱只出現在輸入訊息中,則為 in 參數。

  • MessagePart如果名稱只出現在輸出訊息中,則為 out 參數。

請注意,這個參數清單並非必要專案,即使 Operation 是要搭配 RPC 樣式 Binding 使用也一樣。 請勿直接呼叫 ParameterOrderString 。 這個方法只會在內部用於 XML 序列化。 若要傳回參數清單,請使用 ParameterOrder

適用於