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 { if(msgcontext == null){ msgcontext = org.apache.axis.MessageContext.getCurrentContext(); } 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{ java.util.Properties env = org.apache.geronimo.ews.ws4j2ee.wsutils.PropertyLoader.loadProperties("jndi.properties"); javax.naming.Context initial = new javax.naming.InitialContext(env); Object objref = initial.lookup("ejb/bookquote"); com.jwsbook.jaxrpc.BookQuoteHome home = (com.jwsbook.jaxrpc.BookQuoteHome)javax.rmi.PortableRemoteObject.narrow(objref,com.jwsbook.jaxrpc.BookQuoteHome.class); 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); } }