如何抛出自己的肥皂异常

时间:2014-04-03 12:43:11

标签: c# asp.net web-services .net-2.0

我想抛出我们自己的肥皂异常,就像这样,

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
 <soap:Body>
  <soap:Fault>
   <faultcode>1001</faultcode>              
   <faultstring> This is asdasdaklj</faultstring>
   <detail />
  </soap:Fault>
 </soap:Body>
</soap:Envelope>

1001是我们自己的错误代码,但不知道怎么抛出它?

如果试试这个,

 throw new SoapException("haha", SoapException.ServerFaultCode);

抛出<faultcode>soap:Server</faultcode>

0 个答案:

没有答案
相关问题