C# 无响应Web服务
我有一门网络服务课C# 无响应Web服务,c#,asp.net,web-services,C#,Asp.net,Web Services,我有一门网络服务课 @WebService(serviceName = "Reception", name = "PersonalName") public class webswsdl { public void receptionOC(org.tempuri.SalesOrderHeader salesOrderHeader) { ... ... } } 这很好,Web服务运行良好 但这有一个回应 HTTP/1.1 200 OK Conten
@WebService(serviceName = "Reception", name = "PersonalName")
public class webswsdl {
public void receptionOC(org.tempuri.SalesOrderHeader salesOrderHeader) {
...
...
}
}
这很好,Web服务运行良好
但这有一个回应
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ReceptionOCResponse xmlns="http://tempuri.org/" />
</soap:Body>
</soap:Envelope>
HTTP/1.1200正常
内容类型:text/xml;字符集=utf-8
内容长度:长度
我需要执行相同的Web服务,但没有响应。如果您不想了解此处发生的所有绑定,并且希望它快速且非常直观,那么:
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.End();
只需将其放入web方法函数。为什么要停止响应?什么是无响应?空响应?@Yahia我想停止响应,因为这是公司的请求,我现在不知道该怎么做。@最大原则是没有响应,没有响应。除了@Max之外,您还可以根据需要将响应设置为ServiceUnavailable(503)或NoContent(204)或其他状态,如:response.StatusCode=(int)HttpStatusCode.NoContent;