2009-10-19 48 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; 
     } 
    } 
相关问题