DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15478>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15478

Current Handler implementation doesn't follow the JAX-RPC ver 1.0

           Summary: Current Handler implementation doesn't follow the JAX-
                    RPC ver 1.0
           Product: Axis
           Version: 1.1beta
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Major
          Priority: Other
         Component: Basic Architecture
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]
                CC: [EMAIL PROTECTED]


This is a bug report for the implementation of JAX-RPC type
handler on AXIS 1.1 Beta.

 The JAX-RPC ver1.0[jaxrpc-1_0-fr-spec.pdf] describes at page 91:

------- <CUT> ----- <CUT> ----- <CUT> ----- <CUT> ----- <CUT> -------
@The handleRequest method performs one of the following steps after
performing handler specific processing of the request SOAP message:

- Return true to indicate continued processing of the request handler
 chain. The HandlerChain takes the responsibility of invoking the next
 entity. The next entity may be the next handler in the HandlerChain or
 if this handler is the last handler in the chain, the next entity is
 the target service endpoint. The mechanism for dispatch or invocation
 of the target service endpoint depends on whether the request Handler
 Chain is on the client side or service endpoint side.

- Return false to indicate blocking of the request handler chain. In
 this case, further processing of the request handler chain is blocked
 and the target service endpoint is not dispatched. The JAX-RPC runtime
 system takes the responsibility of invoking the response handler chain
 next with the appropriate SOAPMessageContext. The Handler implementation
 class has the responsibility of setting the response SOAP message in
 the handleRequest method and perform additional processing in the handle
 Response method. In the default processing model, the response handler
 chain starts processing from the same Handler instance (that returned
 false) and goes backward in the execution sequence.
                                 :
                                 :
------- <CUT> ----- <CUT> ----- <CUT> ----- <CUT> ----- <CUT> -------

  However, when I was testing the following sample handler whitch 
returns "false" in handleRequest() method, the target service endpoint 
was invoked.

  This is NOT based on the specification above.

------- <CUT> ----- <CUT> ----- <CUT> ----- <CUT> ----- <CUT> -------
public class ServerHandler implements javax.xml.rpc.handler.Handler {

  public boolean handleRequest(javax.xml.rpc.handler.MessageContext context) {
    System.out.println("ServerHandler: Enter handleRequest(): return false");

    // sets the "fault" status to MessageContext
    context.setProperty("HandlerFault", this.getClass().getName());

    return false;
  }

  public boolean handleResponse(javax.xml.rpc.handler.MessageContext context) {
    String name = (String)context.getProperty("HandlerFault");
    System.out.println("ServerHandler: Enter handleResponse(): name=" + name);

    // create a Response Message when the status is "fault"
    if (name != null && name instanceof String &&
                                     name.equals(this.getClass().getName())) {
      System.out.println("ServerHandler: create a Response Message in Handler");
      // Create a Response Message for the client
             :
             :
    }
    return true;
  }
             :
             :
------- <CUT> ----- <CUT> ----- <CUT> ----- <CUT> ----- <CUT> -------

  In order to fix this problem, I guess that I need to several changes
to SOAPService.java(package org.apache.axis.handlers.soap).

  Finally, I add a prototype of the Handler Engine as follows:

------- <CUT> ----- <CUT> ----- <CUT> ----- <CUT> ----- <CUT> -------
Difference
***** 
SOAPService.java [Modified]

public void invoke(MessageContext msgContext) throws AxisFault {
  HandlerInfoChainFactory handlerFactory =
  (HandlerInfoChainFactory) this.getOption(Constants.ATTR_HANDLERINFOCHAIN);
  HandlerChainImpl handlerImpl = null;
  if (handlerFactory != null) handlerImpl = (HandlerChainImpl)
    handlerFactory.createHandlerChain();

  boolean result = true;
  if (handlerImpl != null) {
    result = handlerImpl.handleRequest(msgContext);
  }
  if (result == true) {
    super.invoke(msgContext);
  }
  else {
    msgContext.setPastPivot(true);
  }
  if ( handlerImpl != null) {
    handlerImpl.handleResponse(msgContext);
    handlerImpl.destroy();
  }
}
*****
SOAPSERVICE.JAVA [Original]

public void invoke(MessageContext msgContext) throws AxisFault {
  HandlerInfoChainFactory handlerFactory =
  (HandlerInfoChainFactory) this.getOption(Constants.ATTR_HANDLERINFOCHAN);
  HandlerChainImpl handlerImpl = null;
  if (handlerFactory != null) handlerImpl = (HandlerChainImpl)
    handlerFactory.createHandlerChain();
  if (handlerImpl != null) handlerImpl.handleRequest(msgContext);

  super.invoke(msgContext);

  if ( handlerImpl != null) {
    handlerImpl.handleResponse(msgContext);
    handlerImpl.destroy();
  }
}
*****
------- <CUT> ----- <CUT> ----- <CUT> ----- <CUT> ----- <CUT> -------
  
Best Regards,

  Toshiyuki Kimrua <[EMAIL PROTECTED]>
  R&D Headquarters
  NTT DATA Corporation

Reply via email to