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;
}
}