[
https://issues.apache.org/jira/browse/RAMPART-305?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12893983#action_12893983
]
Herwig David commented on RAMPART-305:
--------------------------------------
Hi Thilina,
In org.apache.axis2.util.MessageContextBuilder I've changed the method
createFaultMessageContext in the way that also the axisService is copied from
processingContext to faultContext.
After that change the rampart configuration was recognized correctly and the
described runtime error in the fault case was solved. See change below.
Do you see a problem to copy the AxisService to the faultContext ?
Regards,
Herwig
-------------------------------------------------
/**
* This method is called to handle any error that occurs at inflow or
outflow. But if the
* method is called twice, it implies that sending the error handling has
failed, in which case
* the method logs the error and exits.
*/
public static MessageContext createFaultMessageContext(MessageContext
processingContext,
Throwable e)
throws AxisFault {
if (processingContext.isProcessingFault()) {
// We get the error file processing the fault. nothing we can do
throw new
AxisFault(Messages.getMessage("errorwhileProcessingFault"));
}
// See if the throwable is an AxisFault and if it already contains the
// fault MessageContext
if (e instanceof AxisFault) {
MessageContext faultMessageContext = ((AxisFault)
e).getFaultMessageContext();
if (faultMessageContext != null) {
// These may not have been set correctly when the original
context
// was created -- an example of this is with the
SimpleHTTPServer.
// I'm not sure if this is the correct thing to do, or if the
// code that created this context in the first place should
// expect that the transport out info was set correctly, as
// it may need to use that info at some point before we get to
// this code.
faultMessageContext.setProperty(MessageContext.TRANSPORT_OUT,
processingContext.getProperty(
MessageContext.TRANSPORT_OUT));
faultMessageContext.setProperty(Constants.OUT_TRANSPORT_INFO,
processingContext.getProperty(
Constants.OUT_TRANSPORT_INFO));
faultMessageContext.setProcessingFault(true);
return faultMessageContext;
}
}
// Create a basic response MessageContext with basic fields copied
MessageContext faultContext =
createResponseMessageContext(processingContext);
// Register the fault message context
OperationContext operationContext =
processingContext.getOperationContext();
if (operationContext != null) {
processingContext.getAxisOperation().addFaultMessageContext(faultContext,
operationContext);
}
/* INSERT Herwig BEGIN */
AxisService axisService = processingContext.getAxisService();
if (axisService != null) {
faultContext.setAxisService(axisService);
}
/* INSERT Herwig END */
faultContext.setProcessingFault(true);
> If Rampart detects a security error a HTML page is send to the client instead
> of a SOAP fault
> ---------------------------------------------------------------------------------------------
>
> Key: RAMPART-305
> URL: https://issues.apache.org/jira/browse/RAMPART-305
> Project: Rampart
> Issue Type: Bug
> Components: rampart-core
> Affects Versions: 1.4
> Environment: Axis2-1.5..1 is installed as web app under Tomcat 5.5.28
> and uses Rampart 1.4.
> Running on Windows XP
> Reporter: Herwig David
> Assignee: Ruchith Udayanga Fernando
> Attachments: axis2.log, request.txt, response.txt, services.xml,
> WS7X4AssortmentOrder.wsdl
>
>
> If I call a web service with wrong security data rampart correctly detects
> that 'The signature or decryption was invalid'. That's fine.
> Unfortunately I get a NullPointerException when returning to the client
> afterwards.
> Is there a way to just send the SOAP fault back to the client instead of
> sending a HTML page?
> Is this related to issue RAMPART-164?
> I've attached the log file, the wsdl file and messages send between client
> and server.
> Thanks and regards,
> Herwig
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.