3
[WebMethod(EnableSession=true)]
[ScriptMethod(UseHttpGet=true, XmlSerializeString = false)]
public string RaiseCallbackEvent(string eventArgument)
返回值開始<?xml
。我怎樣才能擺脫它?的WebMethod回報String(不<?xml標記)
[WebMethod(EnableSession=true)]
[ScriptMethod(UseHttpGet=true, XmlSerializeString = false)]
public string RaiseCallbackEvent(string eventArgument)
返回值開始<?xml
。我怎樣才能擺脫它?的WebMethod回報String(不<?xml標記)
我想這是因爲它是一個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;
}
}