Operation.ParameterOrderString 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取或设置可选的远程过程调用 (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。