2009-10-19 49 views

回答

3

我想這是因爲它是一個SOAP Web服務,這是從SOAP Web服務期望的。如果你想返回只是純文本格式返回給客戶端,我想創建一個ASHX手動處理請求。

這樣的(這是默認的通用處理器腳手架)

[WebService(Namespace = "http://tempuri.org/")] 
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] 
public class Test : IHttpHandler 
{ 

    public void ProcessRequest(HttpContext context) 
    { 
     context.Response.ContentType = "text/plain"; 
     context.Response.Write("Hello World"); 
    } 

    public bool IsReusable 
    { 
     get 
     { 
      return false; 
     } 
    } 
相關問題