我想抛出我们自己的肥皂异常,就像这样,
<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>