|
Hi Donner and Magnus, Let me explain a bit about Axis2 (current) fault handling. Axis2 SOAP API is SOAP 1.2, which is actually a superset of SOAP 1.1. So you need to handle everything using SOAP 1.2 API. But depending on the factory you use, you will get SOAP 1.1 or SOAP 1.2 serialization. Answering your initial question of creating custom SOAP Faults, When there is a fault, you can set the SOAP fault information to the current message context and those will be fed in to the SOAP fault that will be send. For example, if you want to set your own SOAPFaultCode, do the following. SoapFactory soapFactory = OMAbstractFactory.getSOAP11Factory(); // or getSOAP12Factory() if you want SOAP 1.2 SOAPFaultCode faultCode = soapFactory.createSOAPFaultCode(soapFault); msgCtx.setProperty(SOAP12Constants.SOAP_FAULT_CODE_LOCAL_NAME, faultCode); // set other fault properties throw new AxisFault("reason for exception", exception); If you wanna see how this is being extracted, you can see org.apache.axis2.engine.AxisEngine.extractFaultInformationFromMessageContext(). But to tell you the truth, there is a know defect with OM :-( . I will be fixing that soon. The defect is that you can not create SOAPFaultCode, SOAPFaultReason or any other child of SOAPFault, wothout passing a SOAPFault in to it as the parent. This is, at least for me, a bit inconvenient. I will be changing that ASAP. Hope this information will be helpful. Regards, Eran Chinthaka [EMAIL PROTECTED] wrote: Hi Magnus, The problem you probably have is that your fault is a SOAP 1.1 fault. The Axis2 AxisFault is mapped to SOAP1.2 Fault wich is a superset of the 1.1 one. To create a 'real' SOAP1.1 Fault have a look at org.apache.axis2.soap.impl.dom.soap11.SOAP11FaultImplTed --- Magnus Olsson <[EMAIL PROTECTED]> schrieb:Hi, is it possible to create the following SOAP Fault in axis2? <soap:Envelopexmlns:soap="<http://schemas.xmlsoap.org/soap/envelope/>"><soap:Body> <soap:Faultxmlns:c="<http://www.company.se/faultcodes/2005-12-01/>"> |
signature.asc
Description: OpenPGP digital signature
