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.SOAP11FaultImpl
Ted --- Magnus Olsson <[EMAIL PROTECTED]> schrieb: > Hi, > > is it possible to create the following SOAP Fault in > axis2? > > <soap:Envelope > xmlns:soap="<http://schemas.xmlsoap.org/soap/envelope/>"> > > <soap:Body> > <soap:Fault > xmlns:c="<http://www.company.se/faultcodes/2005-12-01/>"> > > <faultcode>c:InvalidInsuranceId</faultcode> > <faultstring>Illegal insurance > number</faultstring> > <detail> > <foo:FaultData > xmlns:foo="<http://schemas.foo.org/foo/2005-12-01/>"> > > <faultingMessage> > <!-- custom message --> > </faultingMessage> > <xpath> > <!-- custom message --> > </xpath> > <callStack> > <!-- custom message --> > </callStack> > <anyElement> > <!-- custom message --> > </anyElement> > </foo:FaultData> > </detail> > </soap:Fault> > </soap:Body> > </soap:Envelope> > > I tried with the following service, which didn't > succeed. > > public void pingF(OMElement element) throws > AxisFault > { > AxisFault fault = new AxisFault("Illegal > insurance number"); > QName code = new > QName("http://www.company.se/faultcodes/2005-12-01/", > "InvalidInsuranceId", "c"); > fault.setFaultCode(code); > > OMFactory factory = > OMAbstractFactory.getOMFactory(); > OMNamespace ns = > factory.createOMNamespace("http://schemas.foo.org/foo/2005-12-01/","ssek"); > OMElement root = > factory.createOMElement("FaultData",ns); > > OMElement elt1 = > factory.createOMElement("faultingMessage", null); > root.addChild(elt1); > > fault.setDetail(root); > throw fault; > } > > > regards, > > Magnus > ___________________________________________________________ Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de
