package com.jwsbook.jaxrpc; public class BookQuoteBindingImpl implements com.jwsbook.jaxrpc.BookQuote,org.apache.geronimo.ews.ws4j2ee.wsutils.ContextAccssible{ private com.jwsbook.jaxrpc.BookQuoteEJB ejb = null; private org.apache.axis.MessageContext msgcontext; public BookQuoteBindingImpl(){} public void setMessageContext(org.apache.axis.MessageContext msgcontext){; this.msgcontext = msgcontext; } public com.jwsbook.jaxrpc.BookQuoteEJB getRemoteRef()throws org.apache.axis.AxisFault{ try { javax.security.auth.callback.CallbackHandler handler = org.apache.geronimo.ews.ws4j2ee.wsutils.security.jaasmodules. AutenticationCallbackHandlerFactory.createCallbackHandler(msgcontext); if(handler != null){ javax.security.auth.login.LoginContext lc = new javax.security.auth.login.LoginContext("TestClient", handler); lc.login(); } }catch (javax.security.auth.login.LoginException e) { e.printStackTrace(); throw org.apache.axis.AxisFault.makeFault(e); } try{ javax.naming.Context initial = new javax.naming.InitialContext(); Object objref = jndiContext.lookup("java:comp/env/ejb/"bookquote); com.jwsbook.jaxrpc.BookQuoteHome home = (com.jwsbook.jaxrpc.BookQuoteHome)objref; return home.create(); }catch (Exception e) { throw org.apache.axis.AxisFault.makeFault(e); } } public float getBookPrice(java.lang.String isbn) throws java.rmi.RemoteException,com.jwsbook.jaxrpc.InvalidIsbnException{ if(ejb == null) ejb = getRemoteRef(); return ejb.getBookPrice(isbn); } }