dblevins    2005/02/19 04:46:39

  Modified:    modules/core/src/java/org/openejb/server/xfire
                        WSContainer.java
  Log:

  Removed getProxyFactory from EJBContainer interface and all references to it.
  Fixed the WSContainer so it doesn't put instances of InvocationResult in the 
soap message.
  Fixed the invocation test in WSContainerTest.
  Slightly improved the ulgy EJBInvocationStream code.
  
  Revision  Changes    Path
  1.2       +11 -9     
openejb/modules/core/src/java/org/openejb/server/xfire/WSContainer.java
  
  Index: WSContainer.java
  ===================================================================
  RCS file: 
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/server/xfire/WSContainer.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- WSContainer.java  18 Feb 2005 23:22:00 -0000      1.1
  +++ WSContainer.java  19 Feb 2005 09:46:39 -0000      1.2
  @@ -47,11 +47,13 @@
   import java.lang.reflect.Method;
   import java.net.URI;
   import java.net.URL;
  +import java.util.HashMap;
   import java.util.Iterator;
   import java.util.Map;
  -import java.util.HashMap;
   import javax.wsdl.Definition;
   
  +import org.apache.geronimo.core.service.InvocationResult;
  +import org.apache.geronimo.webservices.MessageContextInvocationKey;
   import org.codehaus.xfire.MessageContext;
   import org.codehaus.xfire.XFireRuntimeException;
   import org.codehaus.xfire.fault.Soap11FaultHandler;
  @@ -66,8 +68,6 @@
   import org.openejb.EJBInvocation;
   import org.openejb.EJBInvocationImpl;
   import org.openejb.proxy.ProxyInfo;
  -import org.apache.geronimo.core.service.InvocationKey;
  -import org.apache.geronimo.webservices.MessageContextInvocationKey;
   
   public class WSContainer implements Invoker {
   
  @@ -128,13 +128,15 @@
   
       public Object invoke(Method m, Object[] params, MessageContext context) 
throws XFireFault {
           try {
  -            int index = ejbContainer.getProxyFactory().getMethodIndex(m);
  +            int index = ejbContainer.getMethodIndex(m);
               EJBInvocation invocation = new 
EJBInvocationImpl(EJBInterfaceType.WEB_SERVICE, null, index, params);
  -            //I give up, why would you use xfire?
  -            Map properties = new HashMap();
  -            javax.xml.rpc.handler.MessageContext messageContext = new 
SimpleMessageContext(properties);
  +            javax.xml.rpc.handler.MessageContext messageContext = new 
SimpleMessageContext(new HashMap());
               invocation.put(MessageContextInvocationKey.INSTANCE, 
messageContext);
  -            return ejbContainer.invoke(invocation);
  +            InvocationResult invocationResult = 
ejbContainer.invoke(invocation);
  +            if (invocationResult.isException()) {
  +                throw (Throwable) invocationResult.getException();
  +            }
  +            return invocationResult.getResult();
           } catch (Throwable throwable) {
               throwable.printStackTrace();
               throw new XFireFault("Error invoking EJB", throwable, 
XFireFault.RECEIVER);
  
  
  

Reply via email to