IChannel.Parse(String, String) 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
out 매개 변수로 개체 URI를 반환하고, 반환 값으로 현재 채널의 URI를 반환합니다.
public:
System::String ^ Parse(System::String ^ url, [Runtime::InteropServices::Out] System::String ^ % objectURI);
public string Parse (string url, out string objectURI);
[System.Security.SecurityCritical]
public string Parse (string url, out string objectURI);
abstract member Parse : string * string -> string
[<System.Security.SecurityCritical>]
abstract member Parse : string * string -> string
Public Function Parse (url As String, ByRef objectURI As String) As String
매개 변수
- url
- String
개체의 URL입니다.
반환
현재 채널의 URI이거나, 해당 URI가 이 채널에 속하지 않은 경우 null
입니다.
- 특성
예외
직접 실행 호출자에 인프라 권한이 없는 경우
예제
// Creating the 'IDictionary' to set the server object properties.
IDictionary^ myDictionary = gcnew Hashtable;
myDictionary[ "name" ] = "HttpClientChannel";
myDictionary[ "priority" ] = 2;
// Set the properties along with the constructor.
HttpClientChannel^ myHttpClientChannel = gcnew HttpClientChannel( myDictionary,gcnew BinaryClientFormatterSinkProvider );
// Register the server channel.
ChannelServices::RegisterChannel( myHttpClientChannel );
MyHelloServer ^ myHelloServer1 = dynamic_cast<MyHelloServer^>(Activator::GetObject( MyHelloServer::typeid, "http://localhost:8085/SayHello" ));
if ( myHelloServer1 == nullptr )
System::Console::WriteLine( "Could not locate server" );
else
{
Console::WriteLine( myHelloServer1->myHelloMethod( "Client" ) );
// Get the name of the channel.
Console::WriteLine( "Channel Name :{0}", myHttpClientChannel->ChannelName );
// Get the channel priority.
Console::WriteLine( "ChannelPriority :{0}", myHttpClientChannel->ChannelPriority );
String^ myString;
String^ myObjectURI1;
Console::WriteLine( "Parse :{0}{1}", myHttpClientChannel->Parse( "http://localhost:8085/SayHello", myString ), myString );
// Get the key count.
System::Console::WriteLine( "Keys->Count : {0}", myHttpClientChannel->Keys->Count );
// Get the channel message sink that delivers message to the specified url.
IMessageSink^ myIMessageSink = myHttpClientChannel->CreateMessageSink( "http://localhost:8085/NewEndPoint", nullptr, myObjectURI1 );
Console::WriteLine( "The channel message sink that delivers the messages to the URL is : {0}", myIMessageSink );
Console::WriteLine( "URI of the new channel message sink is: {0}", myObjectURI1 );
}
// Creating the 'IDictionary' to set the server object properties.
IDictionary myDictionary = new Hashtable();
myDictionary["name"]="HttpClientChannel";
myDictionary["priority"]=2;
// Set the properties along with the constructor.
HttpClientChannel myHttpClientChannel =
new HttpClientChannel(myDictionary,new BinaryClientFormatterSinkProvider());
// Register the server channel.
ChannelServices.RegisterChannel(myHttpClientChannel);
MyHelloServer myHelloServer1 = (MyHelloServer)Activator.GetObject(
typeof(MyHelloServer), "http://localhost:8085/SayHello");
if (myHelloServer1 == null)
{
System.Console.WriteLine("Could not locate server");
}
else
{
Console.WriteLine(myHelloServer1.myHelloMethod("Client"));
// Get the name of the channel.
Console.WriteLine("Channel Name :"+myHttpClientChannel.ChannelName);
// Get the channel priority.
Console.WriteLine("ChannelPriority :"+myHttpClientChannel.ChannelPriority.ToString());
string myString,myObjectURI1;
Console.WriteLine("Parse :" +
myHttpClientChannel.Parse("http://localhost:8085/SayHello",out myString)+myString);
// Get the key count.
System.Console.WriteLine("Keys.Count : " + myHttpClientChannel.Keys.Count);
// Get the channel message sink that delivers message to the specified url.
IMessageSink myIMessageSink =
myHttpClientChannel.CreateMessageSink("http://localhost:8085/NewEndPoint",
null,out myObjectURI1);
Console.WriteLine("The channel message sink that delivers the messages to the URL is : "
+myIMessageSink.ToString());
Console.WriteLine("URI of the new channel message sink is: " +myObjectURI1);
}
' Creating the 'IDictionary' to set the server object properties.
Dim myDictionary As New Hashtable()
myDictionary("name") = "HttpClientChannel"
myDictionary("priority") = 2
' Set the properties along with the constructor.
Dim myHttpClientChannel As New _
HttpClientChannel( myDictionary, New BinaryClientFormatterSinkProvider)
' Register the server channel.
ChannelServices.RegisterChannel(myHttpClientChannel)
Dim myHelloServer1 As MyHelloServer = CType(Activator.GetObject(GetType(MyHelloServer), _
"http://localhost:8085/SayHello"), MyHelloServer)
If myHelloServer1 Is Nothing Then
System.Console.WriteLine("Could not locate server")
Else
Console.WriteLine(myHelloServer1.myHelloMethod("Client"))
' Get the name of the channel.
Console.WriteLine("Channel Name :" + myHttpClientChannel.ChannelName)
' Get the channel priority.
Console.WriteLine("ChannelPriority :" + myHttpClientChannel.ChannelPriority.ToString())
Dim myString, myObjectURI1 As String
Console.WriteLine("Parse :" + _
myHttpClientChannel.Parse("http://localhost:8085/SayHello", myString) + myString)
' Get the key count.
System.Console.WriteLine("Keys.Count : " + myHttpClientChannel.Keys.Count.ToString())
' Get the channel message sink that delivers message to the specified url.
Dim myIMessageSink As IMessageSink =myHttpClientChannel.CreateMessageSink( _
"http://localhost:8085/NewEndPoint", Nothing, myObjectURI1)
Console.WriteLine("The channel message sink that delivers the messages to the URL is :" + _
CType(myIMessageSink, Object).ToString)
Console.WriteLine("URI of the new channel message sink is: " + myObjectURI1)
End If
적용 대상
추가 정보
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
.NET