ws-wsrf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sc...@apache.org
Subject svn commit: r264165 - in /webservices/wsrf/trunk/src/java/org/apache/ws: resource/ resource/handler/ resource/handler/axis/ resource/impl/ resource/tool/ resource/tool/velocity/ util/ util/jndi/ util/jndi/tools/ util/platform/ util/platform/axis/ util/...
Date Mon, 29 Aug 2005 16:55:25 GMT
Author: scamp
Date: Mon Aug 29 09:55:16 2005
New Revision: 264165

URL: http://svn.apache.org/viewcvs?rev=264165&view=rev
Log:
Updates for JSR109 implementation

Added:
    webservices/wsrf/trunk/src/java/org/apache/ws/resource/impl/ResourceContextImpl.java
Modified:
    webservices/wsrf/trunk/src/java/org/apache/ws/resource/ResourceCapability.java
    webservices/wsrf/trunk/src/java/org/apache/ws/resource/ResourceDefinition.java
    webservices/wsrf/trunk/src/java/org/apache/ws/resource/handler/ResourceHandler.java
    webservices/wsrf/trunk/src/java/org/apache/ws/resource/handler/axis/AxisResourceContext.java
    webservices/wsrf/trunk/src/java/org/apache/ws/resource/handler/axis/ResourceProvider.java
    webservices/wsrf/trunk/src/java/org/apache/ws/resource/impl/ResourceCapabilityImpl.java
    webservices/wsrf/trunk/src/java/org/apache/ws/resource/impl/ResourceDefinitionImpl.java
    webservices/wsrf/trunk/src/java/org/apache/ws/resource/tool/Wsdl2Java.java
    webservices/wsrf/trunk/src/java/org/apache/ws/resource/tool/velocity/ServiceProperties.java
    webservices/wsrf/trunk/src/java/org/apache/ws/util/OperationInfo.java
    webservices/wsrf/trunk/src/java/org/apache/ws/util/jndi/XmlBeanJndiUtils.java
    webservices/wsrf/trunk/src/java/org/apache/ws/util/jndi/tools/JndiConfigUpdater.java
    webservices/wsrf/trunk/src/java/org/apache/ws/util/platform/JaxRpcPlatform.java
    webservices/wsrf/trunk/src/java/org/apache/ws/util/platform/axis/AxisJaxRpcPlatform.java
    webservices/wsrf/trunk/src/java/org/apache/ws/util/platform/jboss/JBossJaxRpcPlatform.java
    webservices/wsrf/trunk/src/java/org/apache/ws/util/platform/weblogic/WeblogicJaxRpcPlatform.java
    webservices/wsrf/trunk/src/java/org/apache/ws/util/platform/websphere/WebsphereJaxRpcPlatform.java

Modified: webservices/wsrf/trunk/src/java/org/apache/ws/resource/ResourceCapability.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/java/org/apache/ws/resource/ResourceCapability.java?rev=264165&r1=264164&r2=264165&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/java/org/apache/ws/resource/ResourceCapability.java (original)
+++ webservices/wsrf/trunk/src/java/org/apache/ws/resource/ResourceCapability.java Mon Aug 29 09:55:16 2005
@@ -107,4 +107,17 @@
     * @return
     */
    boolean implementsResourceCapability( QName capabilityName );
+
+    /**
+     * Returns a Map containing the OperationInfos for all operations exposed in the wsdl.
+     * @return A Map of all operations as OperationInfos
+     */
+   Map getAllOperations();
+
+    /**
+     * Returns the Binding QName associated with the current porttype
+     *
+     * @return  Binding QName
+     */
+   QName getBindingName();
 }

Modified: webservices/wsrf/trunk/src/java/org/apache/ws/resource/ResourceDefinition.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/java/org/apache/ws/resource/ResourceDefinition.java?rev=264165&r1=264164&r2=264165&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/java/org/apache/ws/resource/ResourceDefinition.java (original)
+++ webservices/wsrf/trunk/src/java/org/apache/ws/resource/ResourceDefinition.java Mon Aug 29 09:55:16 2005
@@ -16,6 +16,7 @@
 package org.apache.ws.resource;
 
 import javax.wsdl.Port;
+import javax.xml.namespace.QName;
 
 /**
  * A WSRF resource definition.
@@ -45,4 +46,11 @@
     * @return the JWSDL Service for this resource definition
     */
    Port getPort(  );
+
+    /**
+     * The wsdl sevice name from the wsdl file.  This is used for JSR109 configurations, but is not used as endpoint.
+     *
+     * @return QName of the wsdl service name.
+     */
+   QName getWsdlServiceName();
 }

Modified: webservices/wsrf/trunk/src/java/org/apache/ws/resource/handler/ResourceHandler.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/java/org/apache/ws/resource/handler/ResourceHandler.java?rev=264165&r1=264164&r2=264165&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/java/org/apache/ws/resource/handler/ResourceHandler.java (original)
+++ webservices/wsrf/trunk/src/java/org/apache/ws/resource/handler/ResourceHandler.java Mon Aug 29 09:55:16 2005
@@ -26,11 +26,17 @@
 import org.apache.ws.resource.i18n.MessagesImpl;
 import org.apache.ws.util.XmlBeanUtils;
 import org.apache.ws.util.NameUtils;
+import org.apache.ws.util.helper.Dom2SaajConverter;
+import org.apache.ws.util.platform.JaxRpcPlatform;
 import org.apache.ws.util.i18n.Messages;
 import org.apache.xmlbeans.XmlException;
 import org.apache.xmlbeans.XmlObject;
 import org.apache.xmlbeans.XmlOptions;
 import org.apache.xmlbeans.impl.values.XmlAnyTypeImpl;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.Element;
+
 import javax.xml.namespace.QName;
 import javax.xml.rpc.JAXRPCException;
 import javax.xml.rpc.handler.GenericHandler;
@@ -46,6 +52,7 @@
 import javax.xml.soap.SOAPMessage;
 import javax.xml.soap.SOAPHeader;
 import javax.xml.soap.SOAPHeaderElement;
+import javax.xml.soap.SOAPElement;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
@@ -61,7 +68,7 @@
  * @author Ian Springer
  * @author Sal Campana
  */
-public abstract class ResourceHandler
+public class ResourceHandler
    extends GenericHandler
 {
    private static final Log LOG = LogFactory.getLog( ResourceHandler.class );
@@ -130,7 +137,7 @@
 
          org.apache.ws.util.soap.Body body = getSoapBody( envelope );
 
-         ResourceContext              resourceContext      = createResourceContext( soapMsgContext );
+         ResourceContext              resourceContext      = JaxRpcPlatform.getJaxRpcPlatform().createResourceContext( soapMsgContext );
          String                       addressingAction     = resourceContext.getRequestAction(  );
          SoapMethodNameMap            methodnameMap        = new ServiceSoapMethodNameMap( resourceContext );
          String                       methodNameFromAction =
@@ -220,7 +227,7 @@
             for ( int i = 0; i < responseBodyElems.size(  ); i++ )
             {
                XmlObject         responseBodyElem = (XmlObject) responseBodyElems.get( i );
-               SOAPBodyElement[] soapBodyElements = createSOAPBodyElements( responseBodyElem );
+               SOAPBodyElement[] soapBodyElements = createSOAPBodyElements( responseBodyElem, responseBody);
                for ( int j = 0; j < soapBodyElements.length; j++ )
                {
                   SOAPBodyElement soapBodyElement = soapBodyElements[j];
@@ -276,25 +283,43 @@
       m_handlerOptions = ( handlerConfig != null ) ? handlerConfig : new HashMap(  );
    }
 
-   /**
-    * Creates a {@link ResourceContext} for this request.
-    *
-    * @param soapMsgContext the JAX-RPC SOAP message context for this request
-    *
-    * @return a ResourceContext for this request
-    */
-   protected abstract ResourceContext createResourceContext( SOAPMessageContext soapMsgContext )
-   throws Exception;
+    protected SOAPBodyElement[] createSOAPBodyElements(XmlObject responseBodyElem, SOAPBody soapBody)
+    {
+        List bodyElems = new ArrayList();
+        Node node = responseBodyElem.newDomNode();
 
-   /**
-    * DOCUMENT_ME
-    *
-    * @param responseBodyElem DOCUMENT_ME
-    *
-    * @return DOCUMENT_ME
-    */
-   protected abstract SOAPBodyElement[] createSOAPBodyElements( XmlObject responseBodyElem );
+        NodeList childNodes = node.getChildNodes();
+        for (int i = 0; i < childNodes.getLength(); i++)
+        {
+            Node child = childNodes.item(i);
 
+            //add all child elements
+            if (child.getNodeType() == Node.ELEMENT_NODE)
+            {
+                try
+                {
+                    SOAPBodyElement soapBodyElement = soapBody.addBodyElement(NameUtils.createName(child.getLocalName(), child.getPrefix(), child.getNamespaceURI()));
+                    Dom2SaajConverter dom2Saaj = new Dom2SaajConverter();
+                    SOAPElement childSoapElement = dom2Saaj.toSOAPElement((Element) child);
+
+                    NodeList children = childSoapElement.getChildNodes();
+
+                    for (int j = 0; j < children.getLength(); j++)
+                    {
+                        soapBodyElement.appendChild(children.item(j));
+                    }
+
+                    bodyElems.add(soapBodyElement);
+                }
+                catch (SOAPException e)
+                {
+                    e.printStackTrace();
+                }
+            }
+        }
+
+        return (SOAPBodyElement[]) bodyElems.toArray(new SOAPBodyElement[0]);
+    }
    /**
     * DOCUMENT_ME
     *

Modified: webservices/wsrf/trunk/src/java/org/apache/ws/resource/handler/axis/AxisResourceContext.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/java/org/apache/ws/resource/handler/axis/AxisResourceContext.java?rev=264165&r1=264164&r2=264165&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/java/org/apache/ws/resource/handler/axis/AxisResourceContext.java (original)
+++ webservices/wsrf/trunk/src/java/org/apache/ws/resource/handler/axis/AxisResourceContext.java Mon Aug 29 09:55:16 2005
@@ -18,7 +18,7 @@
 import org.apache.axis.handlers.soap.SOAPService;
 import org.apache.ws.resource.i18n.Keys;
 import org.apache.ws.resource.i18n.MessagesImpl;
-import org.apache.ws.resource.impl.AbstractResourceContext;
+import org.apache.ws.resource.impl.ResourceContextImpl;
 import org.apache.ws.util.i18n.Messages;
 import javax.xml.rpc.handler.MessageContext;
 import javax.xml.rpc.handler.soap.SOAPMessageContext;
@@ -34,7 +34,7 @@
  * @author Ian Springer
  */
 public class AxisResourceContext
-   extends AbstractResourceContext
+   extends ResourceContextImpl
 {
    //private static final Log LOG = LogFactory.getLog( AxisResourceContext.class.getName(  ) );
    private static final Messages MSG = MessagesImpl.getInstance(  );

Modified: webservices/wsrf/trunk/src/java/org/apache/ws/resource/handler/axis/ResourceProvider.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/java/org/apache/ws/resource/handler/axis/ResourceProvider.java?rev=264165&r1=264164&r2=264165&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/java/org/apache/ws/resource/handler/axis/ResourceProvider.java (original)
+++ webservices/wsrf/trunk/src/java/org/apache/ws/resource/handler/axis/ResourceProvider.java Mon Aug 29 09:55:16 2005
@@ -39,6 +39,7 @@
 import javax.xml.rpc.handler.soap.SOAPMessageContext;
 import javax.xml.soap.SOAPBodyElement;
 import javax.xml.soap.SOAPMessage;
+import javax.xml.soap.SOAPBody;
 import java.io.StringWriter;
 import java.io.Writer;
 import java.util.ArrayList;
@@ -292,9 +293,11 @@
     *
     * @param responseBodyElem DOCUMENT_ME
     *
+    * @param soapBody
     * @return DOCUMENT_ME
     */
-   protected SOAPBodyElement[] createSOAPBodyElements( XmlObject responseBodyElem )
+/*
+   protected SOAPBodyElement[] createSOAPBodyElements(XmlObject responseBodyElem, SOAPBody soapBody)
    {
       List     bodyElems  = new ArrayList(  );
       Node     node       = responseBodyElem.newDomNode(  );
@@ -312,6 +315,7 @@
 
       return (SOAPBodyElement[]) bodyElems.toArray( new SOAPBodyElement[0] );
    }
+*/
 
    private Message createMessage( MessageContext axisMsgContext )
    {

Modified: webservices/wsrf/trunk/src/java/org/apache/ws/resource/impl/ResourceCapabilityImpl.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/java/org/apache/ws/resource/impl/ResourceCapabilityImpl.java?rev=264165&r1=264164&r2=264165&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/java/org/apache/ws/resource/impl/ResourceCapabilityImpl.java (original)
+++ webservices/wsrf/trunk/src/java/org/apache/ws/resource/impl/ResourceCapabilityImpl.java Mon Aug 29 09:55:16 2005
@@ -19,10 +19,17 @@
 import org.apache.ws.resource.ResourceCapability;
 import org.apache.ws.util.WsdlUtils;
 import org.apache.ws.util.WsrfWsdlUtils;
+import org.apache.ws.util.OperationInfo;
+
 import javax.wsdl.Definition;
 import javax.wsdl.Import;
 import javax.wsdl.Operation;
 import javax.wsdl.PortType;
+import javax.wsdl.Binding;
+import javax.wsdl.Input;
+import javax.wsdl.Message;
+import javax.wsdl.Output;
+import javax.wsdl.Part;
 import javax.wsdl.factory.WSDLFactory;
 import javax.wsdl.xml.WSDLReader;
 import javax.xml.namespace.QName;
@@ -55,42 +62,64 @@
    private String     m_metadataDescLocation;
    private QName      m_metadataDescName;
    private URL        m_baseUrl;
+   private QName      m_bindingName;
 
-   /**
-    * Creates a new {@link ResourceCapabilityImpl} based on the specified JWSDL definition and portType.
-    *
-    * @param def a JWSDL definition
-    * @param baseURL
-    */
-   public ResourceCapabilityImpl( Definition def,
-                                  PortType   portType,
-                                  URL        baseURL )
-   throws InvalidWsrfWsdlException
-   {
-      m_def         = def;
-      m_portType    = portType;
-      m_baseUrl     = baseURL;
-      initImplementedPortTypes(  );
-      initCustomOperations(  );
-      initPropertyNames(  );
-      m_metadataDescName        = WsrfWsdlUtils.getMetadataDescriptorName( m_portType );
-      m_metadataDescLocation    = WsrfWsdlUtils.getMetadataDescriptorLocation( m_portType );
-      if ( !m_def.getTargetNamespace(  ).startsWith( "http://docs.oasis-open.org/" ) )
-      {
-         validateOperations(  );
-         validateProperties(  );
-      }
-   }
-
-   /**
-    * DOCUMENT_ME
-    *
-    * @return DOCUMENT_ME
-    */
-   public String[] getCustomOperationNames(  )
-   {
-      return m_customOpNames;
-   }
+    /**
+     * Creates a new {@link ResourceCapabilityImpl} based on the specified JWSDL definition and portType.
+     *
+     * @param def a JWSDL definition
+     * @param baseURL
+     */
+    public ResourceCapabilityImpl( Definition def,
+                                   PortType   portType,
+                                   URL        baseURL )
+    throws InvalidWsrfWsdlException
+    {
+       m_def         = def;
+       m_portType    = portType;
+       m_baseUrl     = baseURL;
+       m_bindingName = getBindingName(def, m_portType.getQName());
+       initImplementedPortTypes(  );
+       initCustomOperations(  );
+       initPropertyNames(  );
+       m_metadataDescName        = WsrfWsdlUtils.getMetadataDescriptorName( m_portType );
+       m_metadataDescLocation    = WsrfWsdlUtils.getMetadataDescriptorLocation( m_portType );
+       if ( !m_def.getTargetNamespace(  ).startsWith( "http://docs.oasis-open.org/" ) )
+       {
+          validateOperations(  );
+          validateProperties(  );
+       }
+    }
+
+    private QName getBindingName(Definition def, QName portTypeQName)
+    {
+        Map bindings = def.getBindings();
+        Iterator iterator = bindings.values().iterator();
+        while (iterator.hasNext())
+        {
+            Binding binding = (Binding) iterator.next();
+            if(binding.getPortType().getQName().equals(portTypeQName))
+            {            
+                return binding.getQName();
+            }
+        }
+        return null;
+    }
+
+    public QName getBindingName()
+    {
+        return m_bindingName;
+    }
+
+    /**
+     * DOCUMENT_ME
+     *
+     * @return DOCUMENT_ME
+     */
+    public String[] getCustomOperationNames(  )
+    {
+       return m_customOpNames;
+    }
 
    /**
     * @return
@@ -519,6 +548,21 @@
       }
 
       return importIsRedundant;
+   }
+
+   public Map getAllOperations()
+   {
+       Map opMap = new HashMap();
+       List operations = m_portType.getOperations();
+
+       for (int i = 0; i < operations.size(); i++)
+       {
+           Operation o =  (Operation)operations.get(i);
+           //does this work??
+           OperationInfo opInfo = new OperationInfo(o, m_portType.getQName().getNamespaceURI());
+           opMap.put(o.getName(), opInfo);
+       }
+       return opMap;
    }
 
    private void initCustomOperations(  )

Added: webservices/wsrf/trunk/src/java/org/apache/ws/resource/impl/ResourceContextImpl.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/java/org/apache/ws/resource/impl/ResourceContextImpl.java?rev=264165&view=auto
==============================================================================
--- webservices/wsrf/trunk/src/java/org/apache/ws/resource/impl/ResourceContextImpl.java (added)
+++ webservices/wsrf/trunk/src/java/org/apache/ws/resource/impl/ResourceContextImpl.java Mon Aug 29 09:55:16 2005
@@ -0,0 +1,403 @@
+/*=============================================================================*
+ *  Copyright 2004 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *=============================================================================*/
+package org.apache.ws.resource.impl;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.ws.Soap1_1Constants;
+import org.apache.ws.addressing.AddressingUtils;
+import org.apache.ws.resource.JndiConstants;
+import org.apache.ws.resource.Resource;
+import org.apache.ws.resource.ResourceContext;
+import org.apache.ws.resource.ResourceContextException;
+import org.apache.ws.resource.ResourceException;
+import org.apache.ws.resource.ResourceHome;
+import org.apache.ws.resource.handler.ResourceHandler;
+import org.apache.ws.resource.faults.FaultException;
+import org.apache.ws.resource.i18n.Keys;
+import org.apache.ws.resource.i18n.MessagesImpl;
+import org.apache.ws.util.i18n.Messages;
+
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.xml.rpc.handler.MessageContext;
+import javax.xml.rpc.handler.soap.SOAPMessageContext;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPHeaderElement;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.soap.SOAPHeader;
+import javax.xml.namespace.QName;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+/**
+ * An implementation of a resource context.
+ */
+public class ResourceContextImpl
+   implements ResourceContext
+{
+   private static final Log      LOG           = LogFactory.getLog( ResourceContextImpl.class.getName(  ) );
+   private static final Messages MSG           = MessagesImpl.getInstance(  );
+   private SOAPMessage           m_msg;
+   private ResourceHome          m_home;
+   private String                m_serviceName;
+   private URL                   m_serviceURL;
+   private Map                   m_propsMap    = Collections.synchronizedMap( new HashMap(  ) );
+   private String                m_baseURL;
+   private String                m_action;
+   private SOAPMessageContext    m_msgContext;
+
+   /**
+    * Creates a new {@link ResourceContextImpl} object.
+    *
+    * @param soapMsgContext SOAP message context corresponding to a particular request
+    */
+   public ResourceContextImpl( SOAPMessageContext soapMsgContext )
+   throws Exception
+   {
+      if ( soapMsgContext == null )
+      {
+         throw new IllegalArgumentException( MSG.getMessage( Keys.NULL_SOAPMSGCTX ) );
+      }
+
+      m_msgContext    = soapMsgContext;
+      m_msg           = soapMsgContext.getMessage(  );
+      extractFields( soapMsgContext );
+      try
+      {
+         m_home = (ResourceHome) new InitialContext(  ).lookup( getResourceHomeLocation(  ) );
+      }
+      catch ( NamingException ne )
+      {
+         ne.printStackTrace(  );
+         throw new ResourceContextException( ne );
+      }
+
+      if ( m_home instanceof AbstractResourceHome )
+      {
+         AbstractResourceHome abstractResourceHome = ( (AbstractResourceHome) m_home );
+
+         //check if home has been initialized
+         synchronized ( abstractResourceHome )
+         {
+            if ( !abstractResourceHome.isInitialized(  ) )
+            {
+               abstractResourceHome.init(  );
+            }
+         }
+      }
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   public String getBaseURL(  )
+   {
+      return m_baseURL;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param name  DOCUMENT_ME
+    * @param value DOCUMENT_ME
+    */
+   public void setProperty( String name,
+                            Object value )
+   {
+      m_propsMap.put( name, value );
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param name DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   public Object getProperty( String name )
+   {
+      return this.m_propsMap.get( name );
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   public Iterator getPropertyNames(  )
+   {
+      return this.m_propsMap.keySet(  ).iterator(  );
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   public String getRequestAction(  )
+   {
+      return m_action;
+   }
+
+   /**
+    * @see org.apache.ws.resource.ResourceContext#getResource()
+    */
+   public Resource getResource(  )
+   throws ResourceException
+   {
+      ResourceHome home = getResourceHome(  );
+      Object       id = home.extractResourceIdentifier( this );
+      return home.find( id );
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   public ResourceHome getResourceHome(  )
+   {
+      return m_home;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   public synchronized String getResourceHomeLocation(  )
+   {
+      String homeLocation =
+         JndiConstants.CONTEXT_NAME_SERVICES + "/" + getServiceName(  ) + "/" + JndiConstants.ATOMIC_NAME_HOME;
+      LOG.debug( MSG.getMessage( Keys.JNDI_HOME_LOCATION, homeLocation ) );
+      return homeLocation;
+   }
+
+   /**
+    * @see ResourceContext#setResponseAction(java.net.URI)
+    */
+   public void setResponseAction( URI action )
+   {
+      if ( action != null )
+      {
+          m_msgContext.setProperty( ResourceHandler.CONTEXT_PROP_WSA_RESPONSE_ACTION, action.toString() );
+      }
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   public SOAPMessage getSOAPMessage(  )
+   {
+      return m_msg;
+   }
+
+   /**
+    * Returns target service name associated with this context.
+    *
+    * @return the target m_serviceName that was set with {@link #setServiceName(String) setService()}. If set to
+    *         <code>null</code> or not set at all, by default it returns the target service name associated with the
+    *         underlying SOAP message context.
+    */
+   public String getServiceName(  )
+   {
+      return m_serviceName;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   public URL getServiceURL(  )
+   {
+      return m_serviceURL;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param name DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   public boolean containsProperty( String name )
+   {
+      return this.m_propsMap.containsKey( name );
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param name DOCUMENT_ME
+    */
+   public void removeProperty( String name )
+   {
+      this.m_propsMap.remove( name );
+   }
+
+   /**
+    * Returns the value of the WS-Addressing Action header element.
+    *
+    * @param msgContext the context for the current SOAP request; must not be null
+    *
+    * @return
+    */
+   protected String getAddressingAction( SOAPMessageContext msgContext )
+   {
+       SOAPHeaderElement actionHeaderElem = AddressingUtils.getHeaderElement( getSOAPHeader( msgContext ), new QName( getAddressingNamespaceURI( msgContext ), "Action" ) );
+       if ( actionHeaderElem == null )
+      {
+         LOG.debug( MSG.getMessage( Keys.NO_WSA_ACTION ) );
+         throw new FaultException( Soap1_1Constants.FAULT_CLIENT,
+                                   "A WS-Addressing Action SOAP header element is required by this endpoint." );
+      }
+       String action = actionHeaderElem.getValue();      
+       try
+       {
+           new URI( action );
+       }
+       catch ( URISyntaxException urise )
+       {
+           LOG.debug( MSG.getMessage( Keys.INVALID_WSA_ACTION, action ) );
+           throw new FaultException( Soap1_1Constants.FAULT_CLIENT,
+                                     "The WS-Addressing Action specified in the SOAP header is not a valid URI." );
+       }
+       LOG.debug( MSG.getMessage( Keys.FOUND_WSA_ACTION, action ) );
+      return action;
+   }
+
+   /**
+    * Sets the target m_serviceName of this context.
+    *
+    * @param serviceName m_serviceName name.
+    */
+   protected void setServiceName( String serviceName )
+   {
+      m_serviceName = serviceName;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param msgContext DOCUMENT_ME
+    *
+    * @return DOCUMENT_ME
+    */
+   protected String getServiceName( MessageContext msgContext )
+   {
+      URL serviceURL = ( m_serviceURL != null ) ? m_serviceURL : getServiceURL(  );
+      //extract just the service name from the url
+      String serviceName = serviceURL.toString();
+      serviceName = serviceName.substring(serviceName.lastIndexOf("/")+1);
+      return serviceName;
+   }
+
+   /**
+    * DOCUMENT_ME
+    *
+    * @param msgContext the context for the current SOAP request; must not be null
+    *
+    * @return DOCUMENT_ME
+    */
+   protected URL getServiceURL( SOAPMessageContext msgContext )
+   {
+      SOAPHeaderElement toHeaderElem = AddressingUtils.getHeaderElement( getSOAPHeader( msgContext ), new QName( getAddressingNamespaceURI( msgContext ), "To" ) );
+      String serviceURL;
+      if ( toHeaderElem != null )
+      {
+         serviceURL = toHeaderElem.getValue();
+      }
+      else
+      {
+         serviceURL = getAddressingNamespaceURI( msgContext ) + "/anonymous";
+      }
+      try
+      {
+         LOG.debug( MSG.getMessage( Keys.GET_SERVICE_URL_FROM_ADDR_HDR, serviceURL ) );
+         return new URL( serviceURL );
+      }
+      catch ( MalformedURLException murle )
+      {
+          LOG.debug( MSG.getMessage( Keys.INVALID_WSA_TO, serviceURL ) );
+          throw new FaultException( Soap1_1Constants.FAULT_CLIENT,
+                                    "The WS-Addressing destination specified in the SOAP header (i.e. wsa:To header element) is not a valid URI." );
+      }
+   }
+
+   private String getBaseURL( URL serviceURL )
+   {
+      String s = serviceURL.toString(  );
+      s = s.substring( 0,
+                       s.lastIndexOf( "/" ) );
+      return s;
+   }
+
+   private void extractFields( SOAPMessageContext msgContext )
+   {
+      m_action         = getAddressingAction( msgContext );
+      m_serviceURL     = getServiceURL( msgContext );
+      m_serviceName    = getServiceName( msgContext );
+      m_baseURL        = getBaseURL( m_serviceURL );
+      extractProperties( msgContext );
+   }
+
+    private String getAddressingNamespaceURI( SOAPMessageContext msgContext )
+    {
+
+        String wsaNsURI = (String) msgContext.getProperty( ResourceHandler.CONTEXT_PROP_WSA_NAMESPACE_URI );
+        if ( wsaNsURI == null )
+        {
+            wsaNsURI = AddressingUtils.getAddressingNamespaceURI( getSOAPHeader( msgContext ) );
+            msgContext.setProperty( ResourceHandler.CONTEXT_PROP_WSA_NAMESPACE_URI, wsaNsURI );
+        }
+        return wsaNsURI;
+    }
+
+    private SOAPHeader getSOAPHeader( SOAPMessageContext msgContext )
+    {
+        try
+        {
+            return msgContext.getMessage().getSOAPHeader();
+        }
+        catch ( SOAPException soape )
+        {
+            throw new RuntimeException( "Failed to extract header from SOAP message.", soape );
+        }
+    }
+
+    private void extractProperties( MessageContext msgContext )
+   {
+      Iterator propertyNames = msgContext.getPropertyNames(  );
+      while ( propertyNames.hasNext(  ) )
+      {
+         String keyName = (String) propertyNames.next(  );
+         m_propsMap.put( keyName,
+                         msgContext.getProperty( keyName ) );
+      }
+   }
+}
\ No newline at end of file

Modified: webservices/wsrf/trunk/src/java/org/apache/ws/resource/impl/ResourceDefinitionImpl.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/java/org/apache/ws/resource/impl/ResourceDefinitionImpl.java?rev=264165&r1=264164&r2=264165&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/java/org/apache/ws/resource/impl/ResourceDefinitionImpl.java (original)
+++ webservices/wsrf/trunk/src/java/org/apache/ws/resource/impl/ResourceDefinitionImpl.java Mon Aug 29 09:55:16 2005
@@ -23,6 +23,7 @@
 import javax.wsdl.PortType;
 import javax.wsdl.extensions.ExtensibilityElement;
 import javax.wsdl.extensions.soap.SOAPAddress;
+import javax.xml.namespace.QName;
 import java.net.URL;
 import java.util.List;
 
@@ -38,27 +39,30 @@
    private Port   m_port;
    private String m_name;
    private String m_endpointURL;
+    private QName m_wsdlServiceName;
 
-   /**
-    * Creates a new {@link ResourceDefinitionImpl} object.
-    *
-    * @param def DOCUMENT_ME
-    * @param port DOCUMENT_ME
-    * @param baseUrl DOCUMENT_ME
-    *
-    * @throws InvalidWsrfWsdlException DOCUMENT_ME
-    */
-   public ResourceDefinitionImpl( Definition      def,
-                                  javax.wsdl.Port port,
-                                  URL             baseUrl )
-   throws InvalidWsrfWsdlException
-   {
-      super( def,
-             getResourcePortType( port ), baseUrl );
-      m_port           = port;
-      m_name           = port.getName(  );
-      m_endpointURL    = extractEndpointURL( m_port );
-   }
+    /**
+     * Creates a new {@link ResourceDefinitionImpl} object.
+     *
+     * @param def DOCUMENT_ME
+     * @param qName
+     * @param port DOCUMENT_ME
+     * @param baseUrl DOCUMENT_ME
+     *
+     * @throws InvalidWsrfWsdlException DOCUMENT_ME
+     */
+    public ResourceDefinitionImpl(Definition def,
+                                  QName wsdlServiceName, javax.wsdl.Port port,
+                                  URL baseUrl)
+    throws InvalidWsrfWsdlException
+    {
+       super( def,
+              getResourcePortType( port ), baseUrl );
+       m_port           = port;
+       m_wsdlServiceName = wsdlServiceName;
+       m_name           = port.getName(  );
+       m_endpointURL    = extractEndpointURL( m_port );
+    }
 
    /**
     * DOCUMENT_ME
@@ -135,4 +139,9 @@
 
       return endpointURL;
    }
+
+    public QName getWsdlServiceName()
+    {
+        return m_wsdlServiceName;
+    }
 }

Modified: webservices/wsrf/trunk/src/java/org/apache/ws/resource/tool/Wsdl2Java.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/java/org/apache/ws/resource/tool/Wsdl2Java.java?rev=264165&r1=264164&r2=264165&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/java/org/apache/ws/resource/tool/Wsdl2Java.java (original)
+++ webservices/wsrf/trunk/src/java/org/apache/ws/resource/tool/Wsdl2Java.java Mon Aug 29 09:55:16 2005
@@ -25,6 +25,7 @@
 import org.apache.velocity.app.Velocity;
 import org.apache.velocity.runtime.RuntimeConstants;
 import org.apache.ws.resource.ResourceDefinition;
+import org.apache.ws.resource.handler.ResourceHandler;
 import org.apache.ws.resource.i18n.Keys;
 import org.apache.ws.resource.i18n.MessagesImpl;
 import org.apache.ws.resource.impl.ResourceDefinitionImpl;
@@ -33,6 +34,8 @@
 import org.apache.ws.util.OperationInfo;
 import org.apache.ws.util.WsrfWsdlUtils;
 import org.apache.ws.util.XmlBeanNameUtils;
+import org.apache.ws.util.jsr109.DummyEndpointImpl;
+import org.apache.ws.util.jsr109.DummyEndpoint;
 import org.apache.ws.util.i18n.Messages;
 import org.apache.ws.util.velocity.CommonsLogLogSystem;
 import org.apache.xmlbeans.XmlObject;
@@ -387,6 +390,10 @@
       props.setPortTypeQName( portTypeQName );
       QName serviceQname = new QName( targetNamespace, serviceName );
       props.setServiceQName( serviceQname );
+
+      props.setWsdlServiceName( resourceDef.getWsdlServiceName());
+
+      props.setServiceMethodMap(resourceDef.getAllOperations());
       return props;
    }
 
@@ -399,6 +406,13 @@
    protected VelocityContext updateVelocityContext( VelocityContext    context,
                                                     ResourceDefinition resourceDef )
    {
+      //dummy endpoint vars for jsr109...
+      context.put("jsr109EndpointClassName", DummyEndpointImpl.class.getName());
+      context.put("jsr109EndpointInterfaceName", DummyEndpoint.class.getName());
+      context.put("jsr109EndpointDummyJavaOperation", DummyEndpoint.class.getMethods()[0].getName());
+
+      //handler var for jsr109
+      context.put("resourceHandlerClassName", ResourceHandler.class.getName());
       return context;
    }
 
@@ -876,6 +890,14 @@
          {
             processTemplate( context, "templates/build.properties.vm", outputFile );
          }
+
+         //jsr109 artifacts
+         outputFile = new File( packageDir, "web.xml" );
+         processTemplate( context, "templates/jsr109/web.vm", outputFile );
+         outputFile = new File( packageDir, "webservices.xml" );
+         processTemplate( context, "templates/jsr109/webservices.vm", outputFile );
+         outputFile = new File( packageDir, capitalizedServiceName + "_jaxrpc-mapping.xml" );
+         processTemplate( context, "templates/jsr109/jaxrpc-mapping.vm", outputFile );
       }
       catch ( Exception e )
       {
@@ -902,6 +924,7 @@
          {
             Port               port        = (Port) iterator.next(  );
             ResourceDefinition resourceDef = new ResourceDefinitionImpl( def,
+                                                                         service.getQName(),
                                                                          port,
                                                                          wsdlFile.toURL(  ) );
             File               serviceDir  = new File( m_outputDir,

Modified: webservices/wsrf/trunk/src/java/org/apache/ws/resource/tool/velocity/ServiceProperties.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/java/org/apache/ws/resource/tool/velocity/ServiceProperties.java?rev=264165&r1=264164&r2=264165&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/java/org/apache/ws/resource/tool/velocity/ServiceProperties.java (original)
+++ webservices/wsrf/trunk/src/java/org/apache/ws/resource/tool/velocity/ServiceProperties.java Mon Aug 29 09:55:16 2005
@@ -93,16 +93,20 @@
    private String             m_webbAppName;
    private String             m_namespaceVersionHolderClassName;
    private String             m_port;
-
-   /**
-    * Creates a new {@link ServiceProperties} object.
-    *
-    * @param resourceDef DOCUMENT_ME
-    */
-   public ServiceProperties( ResourceDefinition resourceDef )
-   {
-      m_resourceDef = resourceDef;
-   }
+    private Map m_serviceMethodMap;
+    private QName m_bindingName;
+    private QName m_wsdlServiceName;
+
+    /**
+     * Creates a new {@link ServiceProperties} object.
+     *
+     * @param resourceDef DOCUMENT_ME
+     */
+    public ServiceProperties( ResourceDefinition resourceDef )
+    {
+       m_resourceDef = resourceDef;
+       m_bindingName = resourceDef.getBindingName();
+    }
 
    /**
     * DOCUMENT_ME
@@ -768,4 +772,28 @@
    {
       return m_resourceDef.implementsResourceCapability( capability );
    }
+
+    public void setServiceMethodMap(Map allOperations)
+    {
+        m_serviceMethodMap = allOperations;
+    }
+    public Map getServiceMethodMap()
+    {
+        return m_serviceMethodMap;
+    }
+
+    public QName getBindingName()
+    {
+        return m_bindingName;
+    }
+
+    public void setWsdlServiceName(QName wsdlServiceName)
+    {
+        m_wsdlServiceName = wsdlServiceName;
+    }
+
+    public QName getWsdlServiceName()
+    {
+        return m_wsdlServiceName;
+    }
 }

Modified: webservices/wsrf/trunk/src/java/org/apache/ws/util/OperationInfo.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/java/org/apache/ws/util/OperationInfo.java?rev=264165&r1=264164&r2=264165&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/java/org/apache/ws/util/OperationInfo.java (original)
+++ webservices/wsrf/trunk/src/java/org/apache/ws/util/OperationInfo.java Mon Aug 29 09:55:16 2005
@@ -40,102 +40,153 @@
    private String m_fullyQualifiedResponseClassName;
    private String m_fullyQualifiedRequestClassName;
 
-   /**
-    * Creates a new {@link OperationInfo} object.
-    *
-    * @param op DOCUMENT_ME
-    * @param targetNamespace DOCUMENT_ME
-    */
-   public OperationInfo( Operation op,
-                         String    targetNamespace )
-   {
-      m_methodName = StringUtils.uncapitalize( op.getName(  ) );
-      Input input = op.getInput(  );
-      if ( input != null )
-      {
-         Map inputParts = input.getMessage(  ).getParts(  );
-         if ( inputParts.size(  ) > 1 )
-         {
-            throw new RuntimeException( "WSDL input message named " + input.getMessage(  ).getQName(  )
-                                        + " has more than one part - input messages must have at most one part." );
-         }
-
-         if ( inputParts.size(  ) == 1 )
-         {
-            Part inputPart = (Part) inputParts.values(  ).iterator(  ).next(  );
-            m_requestElemName                   = inputPart.getElementName(  );
-            m_fullyQualifiedRequestClassName =
-               XmlBeanNameUtils.getDocumentElementXmlBeanClassName( m_requestElemName );
-         }
-         else // no input parts
-         {
-            m_fullyQualifiedRequestClassName    = "";
-         }
-      }
-      else
-      {
-         m_fullyQualifiedRequestClassName = "";
-      }
-
-      Output output = op.getOutput(  );
-      if ( output != null )
-      {
-         Map outputParts = output.getMessage(  ).getParts(  );
-         if ( outputParts.size(  ) > 1 )
-         {
-            throw new RuntimeException( "WSDL output message named " + input.getMessage(  ).getQName(  )
-                                        + " has more than one part - output messages must have at most one part." );
-         }
-
-         if ( outputParts.size(  ) == 1 )
-         {
-            Part outputPart = (Part) outputParts.values(  ).iterator(  ).next(  );
-            m_fullyQualifiedResponseClassName =
-               XmlBeanNameUtils.getDocumentElementXmlBeanClassName( outputPart.getElementName(  ) );
-         }
-         else // no output parts
-         {
-            m_fullyQualifiedResponseClassName = "void";
-         }
-      }
-      else // no output
-      {
-         m_fullyQualifiedResponseClassName = "void";
-      }
-
-      m_methodSig =
-         m_fullyQualifiedResponseClassName + " " + m_methodName + "( " + m_fullyQualifiedRequestClassName
-         + " requestDoc )";
-
-      //add faults to signature....
-      m_faults = op.getFaults(  );
-      if ( !m_faults.isEmpty(  ) )
-      {
-         m_methodSig += " throws ";
-         Iterator iterator = m_faults.keySet(  ).iterator(  );
-         while ( iterator.hasNext(  ) )
-         {
-            String faultName       = (String) iterator.next(  );
-            Fault  fault           = (Fault) m_faults.get( faultName );
-            Part   part            = (Part) fault.getMessage(  ).getParts(  ).values(  ).iterator(  ).next(  );
-            String javaPackageName = GenerationUtils.getJavaPackageName( targetNamespace );
-            if ( part.getElementName(  ) == null )
-            {
-               //its a type..get the name of the type
-               faultName = part.getTypeName(  ).getLocalPart(  );
-            }
-
-            faultName = javaPackageName + "." + faultName + "Exception";
-            m_methodSig += faultName;
-            if ( iterator.hasNext(  ) )
-            {
-               m_methodSig += ", ";
-            }
-         }
-      }
-   }
+   private String m_wsdlOperationName;
+    private String m_paramPosition;
+    private String m_parameterMode;
+    private QName m_requestMsgQName; //if request
+    private String m_requestPartName;
+    private QName m_responseMsgQName; //if response
+    private String m_responsePartName;
+
+    /**
+     * Creates a new {@link OperationInfo} object.
+     *
+     * @param op DOCUMENT_ME
+     * @param targetNamespace DOCUMENT_ME
+     */
+    public OperationInfo( Operation op,
+                          String    targetNamespace )
+    {
+       m_methodName = StringUtils.uncapitalize( op.getName(  ) );
+       m_wsdlOperationName = op.getName();
+       m_paramPosition = "0";
+       m_parameterMode = "IN";
+       Input input = op.getInput(  );
+
+       if ( input != null )
+       {
+          m_requestMsgQName = input.getMessage().getQName();
+          Map inputParts = input.getMessage(  ).getParts(  );
+          if ( inputParts.size(  ) > 1 )
+          {
+             throw new RuntimeException( "WSDL input message named " + input.getMessage(  ).getQName(  )
+                                         + " has more than one part - input messages must have at most one part." );
+          }
+
+          if ( inputParts.size(  ) == 1 )
+          {
+             Part inputPart = (Part) inputParts.values(  ).iterator(  ).next(  );
+             m_requestPartName = inputPart.getName();
+             m_requestElemName                   = inputPart.getElementName(  );
+             m_fullyQualifiedRequestClassName =
+                XmlBeanNameUtils.getDocumentElementXmlBeanClassName( m_requestElemName );
+          }
+          else // no input parts
+          {
+             m_fullyQualifiedRequestClassName    = "";
+          }
+       }
+       else
+       {
+          m_fullyQualifiedRequestClassName = "";
+       }
+
+       Output output = op.getOutput(  );
+       if ( output != null )
+       {
+          m_responseMsgQName = output.getMessage().getQName();
+          Map outputParts = output.getMessage(  ).getParts(  );
+          if ( outputParts.size(  ) > 1 )
+          {
+             throw new RuntimeException( "WSDL output message named " + input.getMessage(  ).getQName(  )
+                                         + " has more than one part - output messages must have at most one part." );
+          }
+
+          if ( outputParts.size(  ) == 1 )
+          {
+             Part outputPart = (Part) outputParts.values(  ).iterator(  ).next(  );
+             m_responsePartName = outputPart.getName();
+             m_fullyQualifiedResponseClassName =
+                XmlBeanNameUtils.getDocumentElementXmlBeanClassName( outputPart.getElementName(  ) );
+          }
+          else // no output parts
+          {
+             m_fullyQualifiedResponseClassName = "void";
+          }
+       }
+       else // no output
+       {
+          m_fullyQualifiedResponseClassName = "void";
+       }
+
+       m_methodSig =
+          m_fullyQualifiedResponseClassName + " " + m_methodName + "( " + m_fullyQualifiedRequestClassName
+          + " requestDoc )";
+
+       //add faults to signature....
+       m_faults = op.getFaults(  );
+       if ( !m_faults.isEmpty(  ) )
+       {
+          m_methodSig += " throws ";
+          Iterator iterator = m_faults.keySet(  ).iterator(  );
+          while ( iterator.hasNext(  ) )
+          {
+             String faultName       = (String) iterator.next(  );
+             Fault  fault           = (Fault) m_faults.get( faultName );
+             Part   part            = (Part) fault.getMessage(  ).getParts(  ).values(  ).iterator(  ).next(  );
+             String javaPackageName = GenerationUtils.getJavaPackageName( targetNamespace );
+             if ( part.getElementName(  ) == null )
+             {
+                //its a type..get the name of the type
+                faultName = part.getTypeName(  ).getLocalPart(  );
+             }
+
+             faultName = javaPackageName + "." + faultName + "Exception";
+             m_methodSig += faultName;
+             if ( iterator.hasNext(  ) )
+             {
+                m_methodSig += ", ";
+             }
+          }
+       }
+    }
+
+    public String getWsdlOperationName()
+    {
+        return m_wsdlOperationName;
+    }
+
+    public String getParamPosition()
+    {
+        return m_paramPosition;
+    }
+
+    public String getParameterMode()
+    {
+        return m_parameterMode;
+    }
+
+    public QName getRequestMsgQName()
+    {
+        return m_requestMsgQName;
+    }
+
+    public String getRequestPartName()
+    {
+        return m_requestPartName;
+    }
+
+    public QName getResponseMsgQName()
+    {
+        return m_responseMsgQName;
+    }
+
+    public String getResponsePartName()
+    {
+        return m_responsePartName;
+    }
 
-   /**
+    /**
     * DOCUMENT_ME
     *
     * @return DOCUMENT_ME

Modified: webservices/wsrf/trunk/src/java/org/apache/ws/util/jndi/XmlBeanJndiUtils.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/java/org/apache/ws/util/jndi/XmlBeanJndiUtils.java?rev=264165&r1=264164&r2=264165&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/java/org/apache/ws/util/jndi/XmlBeanJndiUtils.java (original)
+++ webservices/wsrf/trunk/src/java/org/apache/ws/util/jndi/XmlBeanJndiUtils.java Mon Aug 29 09:55:16 2005
@@ -228,7 +228,9 @@
         XmlBeanNamingContext namingContext = new XmlBeanNamingContext(envContext);
 
         //load the config file
-        JndiConfigDocument jndiConfigDoc = (JndiConfigDocument) XmlObject.Factory.parse(configStream);
+        XmlOptions options = new XmlOptions();
+        options.setLoadStripWhitespace();
+        JndiConfigDocument jndiConfigDoc = (JndiConfigDocument) XmlObject.Factory.parse(configStream, options);
         validateJndiConfig(jndiConfigDoc);
         JndiConfigDocument.JndiConfig jndiConfig = jndiConfigDoc.getJndiConfig();
         GlobalDocument.Global global = jndiConfig.getGlobal();

Modified: webservices/wsrf/trunk/src/java/org/apache/ws/util/jndi/tools/JndiConfigUpdater.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/java/org/apache/ws/util/jndi/tools/JndiConfigUpdater.java?rev=264165&r1=264164&r2=264165&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/java/org/apache/ws/util/jndi/tools/JndiConfigUpdater.java (original)
+++ webservices/wsrf/trunk/src/java/org/apache/ws/util/jndi/tools/JndiConfigUpdater.java Mon Aug 29 09:55:16 2005
@@ -21,6 +21,8 @@
 import org.apache.tools.ant.types.FileSet;
 import org.apache.wsfx.wsrf.jndi.config.JndiConfigDocument;
 import org.apache.wsfx.wsrf.jndi.config.ServiceDocument;
+import org.apache.xmlbeans.XmlOptions;
+
 import java.io.File;
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -183,7 +185,9 @@
    {
       log( "Deploying Jndi-Config " + deployJndiConfig + " to configuration Jndi-Config " + m_jndiConfig + "..." );
       File                          jndiConfigFile = new File( m_jndiConfig );
-      JndiConfigDocument            sourceConfig = JndiConfigDocument.Factory.parse( new File( m_jndiConfig ) );
+      XmlOptions options = new XmlOptions();
+      options.setLoadStripWhitespace();
+      JndiConfigDocument            sourceConfig = JndiConfigDocument.Factory.parse( new File( m_jndiConfig ), options );
       JndiConfigDocument.JndiConfig jndiConfig   = sourceConfig.getJndiConfig(  );
       Map                           services     = new HashMap(  );
       ServiceDocument.Service[]     serviceArray = jndiConfig.getServiceArray(  );
@@ -197,7 +201,8 @@
       for ( int i = 0; i < m_jndiConfigFiles.size(  ); i++ )
       {
          File                      config      = (File) m_jndiConfigFiles.get( i );
-         JndiConfigDocument        newConfig   = JndiConfigDocument.Factory.parse( config );
+
+         JndiConfigDocument        newConfig   = JndiConfigDocument.Factory.parse( config, options );
          ServiceDocument.Service[] newServices = newConfig.getJndiConfig(  ).getServiceArray(  );
          for ( int j = 0; j < newServices.length; j++ )
          {

Modified: webservices/wsrf/trunk/src/java/org/apache/ws/util/platform/JaxRpcPlatform.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/java/org/apache/ws/util/platform/JaxRpcPlatform.java?rev=264165&r1=264164&r2=264165&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/java/org/apache/ws/util/platform/JaxRpcPlatform.java (original)
+++ webservices/wsrf/trunk/src/java/org/apache/ws/util/platform/JaxRpcPlatform.java Mon Aug 29 09:55:16 2005
@@ -20,9 +20,11 @@
 import org.apache.ws.util.platform.websphere.WebsphereJaxRpcPlatform;
 import org.apache.ws.util.platform.jboss.JBossJaxRpcPlatform;
 import org.apache.ws.resource.handler.axis.AxisConstants;
+import org.apache.ws.resource.ResourceContext;
 
 import javax.xml.soap.SOAPException;
 import javax.xml.soap.SOAPFactory;
+import javax.xml.rpc.handler.soap.SOAPMessageContext;
 
 /**
  * An Enumeration of JAX-RPC platform types supported by Apache WSRF.
@@ -97,6 +99,16 @@
    public abstract String toString(  );
 
    /**
+    * Creates a {@link ResourceContext} for this request.
+    *
+    * @param soapMsgContext the JAX-RPC SOAP message context for this request
+    *
+    * @return a ResourceContext for this request
+    */
+   public abstract ResourceContext createResourceContext( SOAPMessageContext soapMsgContext )
+   throws Exception;
+
+   /**
     * Returns the JaxRpcPlatform for this environment. This method is meant to be called from within the classloader
     * hosting the JAX-RPC engine.
     *
@@ -135,7 +147,7 @@
       {
           s_platformType = JBOSS;
       }
-       
+
       if ( s_platformType == null )
       {
          throw new RuntimeException( "Unsupported JAX-RPC platform." );

Modified: webservices/wsrf/trunk/src/java/org/apache/ws/util/platform/axis/AxisJaxRpcPlatform.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/java/org/apache/ws/util/platform/axis/AxisJaxRpcPlatform.java?rev=264165&r1=264164&r2=264165&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/java/org/apache/ws/util/platform/axis/AxisJaxRpcPlatform.java (original)
+++ webservices/wsrf/trunk/src/java/org/apache/ws/util/platform/axis/AxisJaxRpcPlatform.java Mon Aug 29 09:55:16 2005
@@ -16,6 +16,10 @@
 package org.apache.ws.util.platform.axis;
 
 import org.apache.ws.util.platform.JaxRpcPlatform;
+import org.apache.ws.resource.ResourceContext;
+import org.apache.ws.resource.handler.axis.AxisResourceContext;
+
+import javax.xml.rpc.handler.soap.SOAPMessageContext;
 
 /**
  * @author Sal Campana
@@ -86,4 +90,15 @@
    {
       return AXIS_DESC;
    }
+
+    /**
+     * Creates a {@link ResourceContext} for this request.
+     *
+     * @param soapMsgContext the JAX-RPC SOAP message context for this request
+     * @return a ResourceContext for this request
+     */
+    public ResourceContext createResourceContext(SOAPMessageContext soapMsgContext) throws Exception
+    {
+        return new AxisResourceContext(soapMsgContext);
+    }
 }

Modified: webservices/wsrf/trunk/src/java/org/apache/ws/util/platform/jboss/JBossJaxRpcPlatform.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/java/org/apache/ws/util/platform/jboss/JBossJaxRpcPlatform.java?rev=264165&r1=264164&r2=264165&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/java/org/apache/ws/util/platform/jboss/JBossJaxRpcPlatform.java (original)
+++ webservices/wsrf/trunk/src/java/org/apache/ws/util/platform/jboss/JBossJaxRpcPlatform.java Mon Aug 29 09:55:16 2005
@@ -1,6 +1,10 @@
 package org.apache.ws.util.platform.jboss;
 
 import org.apache.ws.util.platform.JaxRpcPlatform;
+import org.apache.ws.resource.ResourceContext;
+import org.apache.ws.resource.impl.ResourceContextImpl;
+
+import javax.xml.rpc.handler.soap.SOAPMessageContext;
 
 
 /**
@@ -65,5 +69,16 @@
     public String toString()
     {
         return JBOSS_DESC;
+    }
+
+    /**
+     * Creates a {@link ResourceContext} for this request.
+     *
+     * @param soapMsgContext the JAX-RPC SOAP message context for this request
+     * @return a ResourceContext for this request
+     */
+    public ResourceContext createResourceContext(SOAPMessageContext soapMsgContext) throws Exception
+    {
+        return new ResourceContextImpl(soapMsgContext);
     }
 }

Modified: webservices/wsrf/trunk/src/java/org/apache/ws/util/platform/weblogic/WeblogicJaxRpcPlatform.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/java/org/apache/ws/util/platform/weblogic/WeblogicJaxRpcPlatform.java?rev=264165&r1=264164&r2=264165&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/java/org/apache/ws/util/platform/weblogic/WeblogicJaxRpcPlatform.java (original)
+++ webservices/wsrf/trunk/src/java/org/apache/ws/util/platform/weblogic/WeblogicJaxRpcPlatform.java Mon Aug 29 09:55:16 2005
@@ -16,6 +16,10 @@
 package org.apache.ws.util.platform.weblogic;
 
 import org.apache.ws.util.platform.JaxRpcPlatform;
+import org.apache.ws.resource.ResourceContext;
+import org.apache.ws.resource.impl.ResourceContextImpl;
+
+import javax.xml.rpc.handler.soap.SOAPMessageContext;
 
 /**
  * @author Sal Campana
@@ -81,4 +85,15 @@
    {
       return WEBLOGIC_DESC;
    }
+
+    /**
+     * Creates a {@link ResourceContext} for this request.
+     *
+     * @param soapMsgContext the JAX-RPC SOAP message context for this request
+     * @return a ResourceContext for this request
+     */
+    public ResourceContext createResourceContext(SOAPMessageContext soapMsgContext) throws Exception
+    {
+        return new ResourceContextImpl(soapMsgContext);
+    }
 }

Modified: webservices/wsrf/trunk/src/java/org/apache/ws/util/platform/websphere/WebsphereJaxRpcPlatform.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/java/org/apache/ws/util/platform/websphere/WebsphereJaxRpcPlatform.java?rev=264165&r1=264164&r2=264165&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/java/org/apache/ws/util/platform/websphere/WebsphereJaxRpcPlatform.java (original)
+++ webservices/wsrf/trunk/src/java/org/apache/ws/util/platform/websphere/WebsphereJaxRpcPlatform.java Mon Aug 29 09:55:16 2005
@@ -1,6 +1,10 @@
 package org.apache.ws.util.platform.websphere;
 
 import org.apache.ws.util.platform.JaxRpcPlatform;
+import org.apache.ws.resource.ResourceContext;
+import org.apache.ws.resource.impl.ResourceContextImpl;
+
+import javax.xml.rpc.handler.soap.SOAPMessageContext;
 
 
 /**
@@ -65,5 +69,16 @@
     public String toString()
     {
         return WEBSPHERE_DESC;
+    }
+
+    /**
+     * Creates a {@link ResourceContext} for this request.
+     *
+     * @param soapMsgContext the JAX-RPC SOAP message context for this request
+     * @return a ResourceContext for this request
+     */
+    public ResourceContext createResourceContext(SOAPMessageContext soapMsgContext) throws Exception
+    {
+        return new ResourceContextImpl(soapMsgContext);
     }
 }



Mime
View raw message