當前位置: 首頁>>代碼示例>>C#>>正文


C# SoapClientMessage.Url屬性代碼示例

本文整理匯總了C#中System.Web.Services.Protocols.SoapClientMessage.Url屬性的典型用法代碼示例。如果您正苦於以下問題:C# SoapClientMessage.Url屬性的具體用法?C# SoapClientMessage.Url怎麽用?C# SoapClientMessage.Url使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在System.Web.Services.Protocols.SoapClientMessage的用法示例。


在下文中一共展示了SoapClientMessage.Url屬性的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: FileStream

newStream.Position = 0;
FileStream myFileStream = new FileStream(filename, FileMode.Append,
   FileAccess.Write);
StreamWriter myStreamWriter = new StreamWriter(myFileStream);
myStreamWriter.WriteLine(
   "================================== Request at "
   + DateTime.Now);

// Print to the log file the request header field for SoapAction header.
myStreamWriter.WriteLine("The SoapAction Http request header field is: ");
myStreamWriter.WriteLine("\t" + message.Action);

// Print to the log file the type of the client that invoked 
// the XML Web service method.
myStreamWriter.WriteLine("The type of the client is: ");
if((message.Client.GetType()).Equals(typeof(MathSvc)))
   myStreamWriter.WriteLine("\tMathSvc");

// Print to the log file the method invoked by the client.
myStreamWriter.WriteLine(
   "The method that has been invoked by the client is:");
myStreamWriter.WriteLine("\t" + message.MethodInfo.Name);

// Print to the log file if the method invoked is OneWay.
if(message.OneWay)
   myStreamWriter.WriteLine(
     "The client doesn't wait for the server to finish processing");
else
   myStreamWriter.WriteLine(
     "The client waits for the server to finish processing");

// Print to the log file the URL of the site that provides 
// implementation of the method.
myStreamWriter.WriteLine(
   "The URL of the XML Web service method that has been requested is: ");
myStreamWriter.WriteLine("\t" + message.Url);
myStreamWriter.WriteLine("The contents of the SOAP envelope are: ");
myStreamWriter.Flush();

// Copy the contents of one stream to another. 
Copy(newStream, myFileStream);
myFileStream.Close();
newStream.Position = 0;

// Copy the contents of one stream to another. 
Copy(newStream, oldStream);
開發者ID:.NET開發者,項目名稱:System.Web.Services.Protocols,代碼行數:46,代碼來源:SoapClientMessage.Url


注:本文中的System.Web.Services.Protocols.SoapClientMessage.Url屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。