RE: custom SoapFault in Axis2

2006-02-16 Thread Jesse Stockall



Were the changes in the axis engine or in the object model 
and SOAP message code? I posted an issue to Jira and I'm wondering if it might 
be affected by your changes.
 
http://issues.apache.org/jira/browse/AXIS2-413
 
Thanks
 
Jesse

  
  
  From: Eran Chinthaka 
  [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 14, 2006 
  12:37 PMTo: axis-user@ws.apache.orgSubject: Re: custom 
  SoapFault in Axis2
  Hi Magnus and all,I just fixed some of the bugs that were 
  there with the fault handling and added a test case too for that. Now you can 
  use the customized fault handling. See [1], if you wanna know how to create 
  custom faults.Let me know if you have any more concerns on 
  this.-- Chinthaka[1] : http://svn.apache.org/repos/asf/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/util/FaultHandler.javaEran 
  Chinthaka wrote: 
  Hi Magnus,

Magnus Olsson wrote:

  
Hi Erin,
 

You must have meant Eran ;-)

  
how would I create a custom SOAP Fault if the fault is generated by Axis (i.e. not in the service itself)? Lets say that the service is missing, could the SOAP Fault be customized somehow? By using a handler in the out fault flow?
 

Sorry for the late reply. I'm writing a test case for you all to see how
faults can be custommized. I'm not done with this test, but you can have
a look at that.

What I have done there was, I deployed a handler in the server side,
which simply throw an AxisFault. Before that it puts some information to
the message context, so that Axis2 fault handling is picking that up.
I invoked a service from ServiceClient and trying to validate the recd
SOAPfault. I found some bugs in om and Axis2 engine. Give me some time
to finish this, but if you want you can take a loot at the test
org.apache.axis2.engine.FaultHandlingTest in integration module [1].
(this is not a test still, I'm testing with a System.out. Will put a
XMLUnit in to this soon)

-- Chinthaka

[1] :
http://svn.apache.org/viewcvs.cgi/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/FaultHandlingTest.java?view=markup


  
 




SOAPFaultSubCode is lost on serialization

2006-01-20 Thread Jesse Stockall
Using axis2-0.94

When creating a fault with a value and subcode the element added last is
lost when the fault is serialized.

SOAPFactory sf = OMAbstractFactory.getSOAP12Factory();
SOAPEnvelope env = sf.createSOAPEnvelope();
SOAPBody body = sf.createSOAPBody(env);
SOAPFault fault = sf.createSOAPFault(body);
SOAPFaultCode faultCode = sf.createSOAPFaultCode(fault);
SOAPFaultValue faultValue = sf.createSOAPFaultValue(faultCode);
SOAPFaultSubCode subCode = sf.createSOAPFaultSubCode(faultCode;
fault.serialize(System.out);

Will print:

http://www.w3.org/2003/05/soap-envelope";>
  

  


If I create the subcode before the value:

SOAPFactory sf = OMAbstractFactory.getSOAP12Factory();
SOAPEnvelope env = sf.createSOAPEnvelope();
SOAPBody body = sf.createSOAPBody(env);
SOAPFault fault = sf.createSOAPFault(body);
SOAPFaultCode faultCode = sf.createSOAPFaultCode(fault);
SOAPFaultSubCode subCode = sf.createSOAPFaultSubCode(faultCode);
SOAPFaultValue faultValue = sf.createSOAPFaultValue(faultCode);
fault.serialize(System.out);

Will print:

http://www.w3.org/2003/05/soap-envelope";>
  

  



fault.getCode().getSubCode() and fault.getCode().getValue() both return
the expected values no matter the order they are created in.

Thanks

Jesse