I am calling it during an active invocation on the server side (not sure how you would call it outside of an active invocation there?). I basically have a method in my service like this:
public String getFile( String ) { // NullPointerException thrown here because AxisEngine.getCurrentMessageContext() is null. Message rspmsg = AxisEngine.getCurrentMessageContext().getResponseMessage(); // File attachment code here. return someString; } Shouldn't there be an active invocation context in this case? Thanks. Tony >>> [EMAIL PROTECTED] 04/01/04 10:24AM >>> Hi Tony: > So, I am back to my original question. Why does > AxisEngine.getCurrentMessageContext() return null? It returns null if there isn't a current MessageContext. When are you calling it? If you're calling it outside the context of an active invocation, you won't get anything because there is no "current" MessageContext. If you're on the client side and you've already returned from the call.invoke() or the stub method call, you won't get anything. The correct thing to do in those cases is to use call.getMessageContext() or locator.getCall().getMessageContext(), both of which return the last MC which was used, even though the interaction is technically over. --Glen