You are viewing a plain text version of this content. The canonical link for it is here.
Posted to muse-commits@ws.apache.org by sc...@apache.org on 2006/06/02 19:33:13 UTC
svn commit: r411218 [11/34] - in /webservices/muse: branches/1.0/
branches/1.0/src/examples/broker/ branches/1.0/src/examples/broker/WEB-INF/
branches/1.0/src/examples/consumer/ branches/1.0/src/examples/consumer/epr/
branches/1.0/src/examples/consumer...
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/resource/faults/v2004_06/FaultsConstants.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/resource/faults/v2004_06/FaultsConstants.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/resource/faults/v2004_06/FaultsConstants.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/resource/faults/v2004_06/FaultsConstants.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,44 @@
+/*=============================================================================*
+ * 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.faults.v2004_06;
+
+import org.apache.ws.resource.v2004_06.WsrfConstants;
+
+/**
+ * Constants for namespaces defined by the 2004/06 version of the WSRF BaseFaults specification.
+ */
+public interface FaultsConstants
+{
+ /**
+ * Namespace URI for WS-BaseFaults schema.
+ */
+ String NSURI_BASEFAULTS_SCHEMA = WsrfConstants.BASE_URI_WSRF + "wsrf-WS-BaseFaults-1.2-draft-01.xsd";
+
+ /**
+ * Namespace prefix for WS-BaseFaults schema.
+ */
+ String NSPREFIX_BASEFAULTS_SCHEMA = "wsbf";
+
+ /**
+ * Namespace URI for WS-BaseFaults WSDL.
+ */
+ String NSURI_BASEFAULTS_WSDL = WsrfConstants.BASE_URI_WSRF + "wsrf-WS-BaseFaults-1.2-draft-01.wsdl";
+
+ /**
+ * Namespace prefix for WS-BaseFaults WSDL.
+ */
+ String NSPREFIX_BASEFAULTS_WSDL = "wsbfw";
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/resource/faults/v2004_11/FaultsConstants.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/resource/faults/v2004_11/FaultsConstants.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/resource/faults/v2004_11/FaultsConstants.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/resource/faults/v2004_11/FaultsConstants.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,44 @@
+/*=============================================================================*
+ * 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.faults.v2004_11;
+
+import org.apache.ws.resource.v2004_11.WsrfConstants;
+
+/**
+ * Constants for namespaces defined by the 2004/11 version of the WSRF BaseFaults specification.
+ */
+public interface FaultsConstants
+{
+ /**
+ * Namespace URI for WS-BaseFaults schema.
+ */
+ String NSURI_BASEFAULTS_SCHEMA = WsrfConstants.BASE_URI_WSRF + "wsrf-WS-BaseFaults-1.2-draft-03.xsd";
+
+ /**
+ * Namespace prefix for WS-BaseFaults schema.
+ */
+ String NSPREFIX_BASEFAULTS_SCHEMA = "wsrf-bf";
+
+ /**
+ * Namespace URI for WS-BaseFaults WSDL.
+ */
+ String NSURI_BASEFAULTS_WSDL = WsrfConstants.BASE_URI_WSRF + "wsrf-WS-BaseFaults-1.2-draft-03.wsdl";
+
+ /**
+ * Namespace prefix for WS-BaseFaults WSDL.
+ */
+ String NSPREFIX_BASEFAULTS_WSDL = "wsrf-bfw";
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/resource/handler/AbstractSoapMethodNameMap.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/resource/handler/AbstractSoapMethodNameMap.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/resource/handler/AbstractSoapMethodNameMap.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/resource/handler/AbstractSoapMethodNameMap.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,131 @@
+/*=============================================================================*
+ * 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.handler;
+
+import javax.xml.namespace.QName;
+
+/**
+ * LOG-DONE
+ * Abstract class to provide default underlying behaviour for
+ * the SOAPMethodNameMap.
+ *
+ * @author Sal Campana
+ */
+public abstract class AbstractSoapMethodNameMap
+ implements SoapMethodNameMap
+{
+ /**
+ * The Parent SoapMethodNameMap.
+ */
+ SoapMethodNameMap m_parent;
+
+ /**
+ * Returns a default name for a method based on a request's QName.
+ *
+ * @param requestName QName of the incoming request.
+ *
+ * @return a default name for the method.
+ */
+ public abstract String getDefaultMethodName( QName requestName );
+
+ /**
+ * Returns the method name for a given incoming request QName.
+ *
+ * @param requestName
+ *
+ * @return Method name to invoke.
+ */
+ public final String getMethodName( QName requestName )
+ {
+ SoapMethodNameMap parent = getParent( );
+ String methodName = null;
+ if ( parent != null )
+ {
+ methodName = parent.getMethodName( requestName );
+ }
+
+ if ( methodName == null )
+ {
+ methodName = getDefaultMethodName( requestName );
+ }
+
+ return methodName;
+ }
+
+ /**
+ * Returns the method name for an operation which
+ * is registered via its WS-Addressing Action header
+ * value.
+ *
+ * @param action The WS-AAddressing Action Header value.
+ *
+ * @return the name of the operation OR null if there is no Action registered.
+ */
+ public final String getMethodNameFromAction( String action )
+ {
+ if ( action == null )
+ {
+ return null;
+ }
+
+ SoapMethodNameMap parent = getParent( );
+ String methodName = null;
+ if ( parent != null )
+ {
+ methodName = parent.getMethodNameFromAction( action );
+ }
+
+ if ( methodName == null )
+ {
+ methodName = lookupMethodNameFromAction( action );
+ }
+
+ return methodName;
+ }
+
+ /**
+ * Sets the parent SoapMethodNameMap to be searched.
+ *
+ * @param parent
+ */
+ public void setParent( SoapMethodNameMap parent )
+ {
+ m_parent = parent;
+ }
+
+ /**
+ * Returns the parent SoapMethodNameMap
+ *
+ * @return parent SoapMethodNameMap
+ */
+ public SoapMethodNameMap getParent( )
+ {
+ return m_parent;
+ }
+
+ /**
+ * Returns a default name for a method based on a request's WS-Addressing Action header.
+ * Subclasses that wish to support mapping based on wsa:Action should override this method.
+ *
+ * @param action string representation of WS-Addressing Action header value
+ *
+ * @return a method name, or null if no mapping is configured for the specified wsa:Action
+ */
+ protected String lookupMethodNameFromAction( String action )
+ {
+ return null;
+ }
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/resource/handler/DefaultMethodMap.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/resource/handler/DefaultMethodMap.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/resource/handler/DefaultMethodMap.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/resource/handler/DefaultMethodMap.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,177 @@
+/*=============================================================================*
+ * 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.handler;
+
+import org.apache.ws.resource.metadataexchange.v2004_09.MetadataExchangeConstants;
+import javax.xml.namespace.QName;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Maps message-part element QNames from spec WSDLs to Java method names.
+ *
+ * @author Sal Campana, Ian P. Springer
+ */
+public class DefaultMethodMap
+ extends AbstractSoapMethodNameMap
+{
+ private static final Map METHOD_MAP = initMap( );
+ private SoapMethodNameMap m_parent;
+
+ /**
+ * Creates a new {@link DefaultMethodMap} object.
+ *
+ * @param parent DOCUMENT_ME
+ */
+ public DefaultMethodMap( SoapMethodNameMap parent )
+ {
+ m_parent = parent;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param request DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public String getDefaultMethodName( QName request )
+ {
+ return (String) METHOD_MAP.get( request );
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public SoapMethodNameMap getParent( )
+ {
+ return m_parent;
+ }
+
+ /**
+ * Returns a Default name for a method based on a request's WS-Addressing Action Header.
+ *
+ * @param action String representation of WS-Addressing Action Header Value
+ * @return The name of the operation OR null if there is no Action registered.
+ */
+ public String lookupMethodNameFromAction( String action )
+ {
+ return (String) METHOD_MAP.get( action );
+ }
+
+ private static void addWsrlOperations( Map map )
+ {
+ //draft 01
+ map.put( new QName( org.apache.ws.resource.lifetime.v2004_06.ResourceLifetimeConstants.NSURI_WSRL_SCHEMA,
+ "SetTerminationTime",
+ org.apache.ws.resource.lifetime.v2004_06.ResourceLifetimeConstants.NSPREFIX_WSRL_SCHEMA ),
+ "setTerminationTime" );
+ map.put( new QName( org.apache.ws.resource.lifetime.v2004_06.ResourceLifetimeConstants.NSURI_WSRL_SCHEMA,
+ "Destroy",
+ org.apache.ws.resource.lifetime.v2004_06.ResourceLifetimeConstants.NSPREFIX_WSRL_SCHEMA ),
+ "destroy" );
+
+ //draft 04
+ map.put( new QName( org.apache.ws.resource.lifetime.v2004_11.ResourceLifetimeConstants.NSURI_WSRL_SCHEMA,
+ "SetTerminationTime",
+ org.apache.ws.resource.lifetime.v2004_11.ResourceLifetimeConstants.NSPREFIX_WSRL_SCHEMA ),
+ "setTerminationTime" );
+ map.put( new QName( org.apache.ws.resource.lifetime.v2004_11.ResourceLifetimeConstants.NSURI_WSRL_SCHEMA,
+ "Destroy",
+ org.apache.ws.resource.lifetime.v2004_11.ResourceLifetimeConstants.NSPREFIX_WSRL_SCHEMA ),
+ "destroy" );
+ }
+
+ private static void addWsrpOperations( Map map )
+ {
+ //draft 01
+ map.put( new QName( org.apache.ws.resource.properties.v2004_06.ResourcePropertiesConstants.NSURI_WSRP_SCHEMA,
+ "GetResourceProperty",
+ org.apache.ws.resource.properties.v2004_06.ResourcePropertiesConstants.NSPREFIX_WSRP_SCHEMA ),
+ "getResourceProperty" );
+ map.put( new QName( org.apache.ws.resource.properties.v2004_06.ResourcePropertiesConstants.NSURI_WSRP_SCHEMA,
+ "QueryResourceProperties",
+ org.apache.ws.resource.properties.v2004_06.ResourcePropertiesConstants.NSPREFIX_WSRP_SCHEMA ),
+ "queryResourceProperties" );
+ map.put( new QName( org.apache.ws.resource.properties.v2004_06.ResourcePropertiesConstants.NSURI_WSRP_SCHEMA,
+ "SetResourceProperties",
+ org.apache.ws.resource.properties.v2004_06.ResourcePropertiesConstants.NSPREFIX_WSRP_SCHEMA ),
+ "setResourceProperties" );
+ map.put( new QName( org.apache.ws.resource.properties.v2004_06.ResourcePropertiesConstants.NSURI_WSRP_SCHEMA,
+ "GetMultipleResourceProperties",
+ org.apache.ws.resource.properties.v2004_06.ResourcePropertiesConstants.NSPREFIX_WSRP_SCHEMA ),
+ "getMultipleResourceProperties" );
+
+ //draft 05
+ map.put( new QName( org.apache.ws.resource.properties.v2004_06.ResourcePropertiesConstants.NSURI_WSRP_SCHEMA,
+ "GetResourceProperty",
+ org.apache.ws.resource.properties.v2004_06.ResourcePropertiesConstants.NSPREFIX_WSRP_SCHEMA ),
+ "getResourceProperty" );
+ map.put( new QName( org.apache.ws.resource.properties.v2004_06.ResourcePropertiesConstants.NSURI_WSRP_SCHEMA,
+ "QueryResourceProperties",
+ org.apache.ws.resource.properties.v2004_06.ResourcePropertiesConstants.NSPREFIX_WSRP_SCHEMA ),
+ "queryResourceProperties" );
+ map.put( new QName( org.apache.ws.resource.properties.v2004_06.ResourcePropertiesConstants.NSURI_WSRP_SCHEMA,
+ "SetResourceProperties",
+ org.apache.ws.resource.properties.v2004_06.ResourcePropertiesConstants.NSPREFIX_WSRP_SCHEMA ),
+ "setResourceProperties" );
+ map.put( new QName( org.apache.ws.resource.properties.v2004_06.ResourcePropertiesConstants.NSURI_WSRP_SCHEMA,
+ "GetMultipleResourceProperties",
+ org.apache.ws.resource.properties.v2004_06.ResourcePropertiesConstants.NSPREFIX_WSRP_SCHEMA ),
+ "getMultipleResourceProperties" );
+
+ map.put( new QName( org.apache.ws.resource.properties.v2004_06.ResourcePropertiesConstants.NSURI_WSRP_SCHEMA,
+ "GetResourcePropertyDocument",
+ org.apache.ws.resource.properties.v2004_06.ResourcePropertiesConstants.NSPREFIX_WSRP_SCHEMA ),
+ "getResourcePropertyDocument" );
+ map.put( new QName( org.apache.ws.resource.properties.v2004_06.ResourcePropertiesConstants.NSURI_WSRP_SCHEMA,
+ "InsertResourceProperties",
+ org.apache.ws.resource.properties.v2004_06.ResourcePropertiesConstants.NSPREFIX_WSRP_SCHEMA ),
+ "insertResourceProperties" );
+ map.put( new QName( org.apache.ws.resource.properties.v2004_06.ResourcePropertiesConstants.NSURI_WSRP_SCHEMA,
+ "UpdateResourceProperties",
+ org.apache.ws.resource.properties.v2004_06.ResourcePropertiesConstants.NSPREFIX_WSRP_SCHEMA ),
+ "updateResourceProperties" );
+ map.put( new QName( org.apache.ws.resource.properties.v2004_06.ResourcePropertiesConstants.NSURI_WSRP_SCHEMA,
+ "DeleteResourceProperties",
+ org.apache.ws.resource.properties.v2004_06.ResourcePropertiesConstants.NSPREFIX_WSRP_SCHEMA ),
+ "deleteResourceProperties" );
+ }
+
+ /**
+ * Adds the WS-MetadataExchange operation and Action String to the map
+ * @param map
+ */
+ private static void addWsxOperations( Map map )
+ {
+ //put this in as string for looking up the "Get/Request" operation
+ map.put( MetadataExchangeConstants.ACTION_GET_REQUEST, "get" );
+
+ //put this in as string for looking up the "GetMetadata/Request" operation
+ map.put( MetadataExchangeConstants.ACTION_GETMETADATA_REQUEST, "getMetadata" );
+ }
+
+ private static Map initMap( )
+ {
+ Map map = new HashMap( );
+ addWsrpOperations( map );
+ addWsrlOperations( map );
+ addWsxOperations( map );
+ return map;
+ }
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/resource/handler/ResourceHandler.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/resource/handler/ResourceHandler.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/resource/handler/ResourceHandler.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/resource/handler/ResourceHandler.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,673 @@
+/*=============================================================================*
+ * 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.handler;
+
+import org.apache.commons.lang.exception.ExceptionUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.ws.Soap1_1Constants;
+import org.apache.ws.resource.ResourceContext;
+import org.apache.ws.resource.ResourceContextException;
+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.XmlBeanUtils;
+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 javax.xml.namespace.QName;
+import javax.xml.rpc.JAXRPCException;
+import javax.xml.rpc.handler.GenericHandler;
+import javax.xml.rpc.handler.HandlerInfo;
+import javax.xml.rpc.handler.MessageContext;
+import javax.xml.rpc.handler.soap.SOAPMessageContext;
+import javax.xml.rpc.soap.SOAPFaultException;
+import javax.xml.soap.MessageFactory;
+import javax.xml.soap.SOAPBody;
+import javax.xml.soap.SOAPBodyElement;
+import javax.xml.soap.SOAPEnvelope;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Base class for platform-specific providers; also is a JAX-RPC Handler to make it easier to port to different SOAP
+ * platforms.
+ *
+ * @author Ian Springer
+ * @author Sal Campana
+ */
+public abstract class ResourceHandler
+ extends GenericHandler
+{
+ private static final Log LOG = LogFactory.getLog( ResourceHandler.class );
+
+ /**
+ * DOCUMENT_ME
+ */
+ public static final Messages MSG = MessagesImpl.getInstance( );
+
+ /**
+ * DOCUMENT_ME
+ */
+ private static final String WSRF_RESPONSE_XMLOBJECT_LIST = "WSRF_RESPONSE_XMLOBJECT_LIST";
+
+ /**
+ * DOCUMENT_ME
+ */
+ public static final String SERVICE_OPT_WSDL_TARGET_NAMESPACE = "wsdlTargetNamespace";
+
+ /**
+ * DOCUMENT_ME
+ */
+ public static final String SERVICE_OPT_SERVICE_CLASS_NAME = "serviceClassName";
+
+ /** DOCUMENT_ME */
+ public static final String HANDLER_OPT_VALIDATE_REQUEST_XML = "validateRequestXml";
+
+ static
+ {
+ ExceptionUtils.addCauseMethodName( "getLinkedCause" ); // for JAXRPCException
+ }
+
+ private Map m_handlerOptions;
+
+ /**
+ * This handler acts as the pivot and does not process any SOAP header elements.
+ *
+ * @return the names of the SOAP header elements that this handler processes
+ */
+ public QName[] getHeaders( )
+ {
+ return new QName[0];
+ }
+
+ /**
+ * Deserializes the incoming SOAP request to an XMLBean and dispatches it to the appropriate service. It is required
+ * that the request meet the following criteria: <ol> <li>SOAP Header contains the header elements required by
+ * WS-Addressing (either 2003/03 or 2004/08)</li> <li>SOAP Body contains no more than one body element</li> </ol>
+ */
+ public boolean handleRequest( MessageContext msgContext )
+ {
+ try
+ {
+ LOG.debug( MSG.getMessage( Keys.RECEIVED_REQUEST ) );
+ SOAPMessageContext soapMsgContext = (SOAPMessageContext) msgContext;
+ SOAPEnvelope envelope = soapMsgContext.getMessage( ).getSOAPPart( ).getEnvelope( );
+ if ( LOG.isDebugEnabled( ) )
+ {
+ LOG.debug( "Received SOAP request: \n" + envelope );
+ }
+
+ org.apache.ws.util.soap.Body body = getSoapBody( envelope );
+
+ ResourceContext resourceContext = createResourceContext( soapMsgContext );
+ String addressingAction = resourceContext.getRequestAction( );
+ SoapMethodNameMap methodnameMap = new ServiceSoapMethodNameMap( resourceContext );
+ String methodNameFromAction =
+ methodnameMap.getMethodNameFromAction( addressingAction );
+ List responseBodyElems = new ArrayList( );
+
+ Class serviceClass = getServiceClassName( resourceContext );
+ WsrfService service = createService( serviceClass, resourceContext );
+ XmlObject[] childElems = XmlBeanUtils.getChildElements( body.getXmlObject( ) );
+ Method serviceMethod = null;
+
+ if ( childElems.length > 1 )
+ {
+ throw new FaultException( Soap1_1Constants.FAULT_CLIENT,
+ "SOAP request Body contains more than one body element - this service requires that all SOAP requests contain at most one body element." );
+ }
+
+ XmlObject requestXBean;
+ if ( childElems.length == 0 ) // empty Body
+ {
+ requestXBean = null;
+ if ( methodNameFromAction != null )
+ {
+ // try to find a method based on the wsa:Action...
+ serviceMethod = getServiceMethod( service, methodNameFromAction );
+ }
+ else // empty Body and unmapped wsa:Action
+ {
+ throw new FaultException( Soap1_1Constants.FAULT_CLIENT,
+ "No SOAP Body elements were defined, and the value of the WS-Addressing Action header was not recognized - unable to dispatch request." );
+ }
+ }
+ else // childElems.length == 1
+ {
+ requestXBean = toDocumentXmlBean( childElems[0] );
+ validateRequestXml( requestXBean );
+ if ( methodNameFromAction != null )
+ {
+ serviceMethod = getServiceMethod( service, methodNameFromAction, requestXBean ); //get method based on Action
+ }
+ else
+ {
+ serviceMethod = getServiceMethod( service, requestXBean ); //get method based solely on request elem
+ }
+ }
+
+ LOG.debug( MSG.getMessage( Keys.INVOKING_SERVICE_METHOD,
+ serviceMethod.getName( ) ) );
+ XmlObject responseXBean = invokeServiceMethod( serviceMethod, service, requestXBean, serviceClass );
+ if ( responseXBean != null )
+ {
+ responseBodyElems.add( responseXBean );
+ }
+
+ if ( !responseBodyElems.isEmpty( ) )
+ {
+ msgContext.setProperty( WSRF_RESPONSE_XMLOBJECT_LIST, responseBodyElems );
+ }
+ }
+ catch ( Exception e )
+ {
+ handleException( e );
+ }
+
+ return false; // short-circuit any remaining Handlers in chain
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param messageContext DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public boolean handleResponse( MessageContext messageContext )
+ {
+ try
+ {
+ LOG.debug( MSG.getMessage( Keys.HANDLING_RESPONSE ) );
+ SOAPEnvelope responseEnvelope = getResponseEnvelope( (SOAPMessageContext) messageContext );
+ List responseBodyElems = (List) messageContext.getProperty( WSRF_RESPONSE_XMLOBJECT_LIST );
+ LOG.debug( MSG.getMessage( Keys.FOUND_RESP_ELEMS,
+ Integer.toString( responseBodyElems.size( ) ) ) );
+ if ( responseBodyElems != null )
+ {
+ SOAPBody responseBody = responseEnvelope.getBody( );
+ for ( int i = 0; i < responseBodyElems.size( ); i++ )
+ {
+ XmlObject responseBodyElem = (XmlObject) responseBodyElems.get( i );
+ SOAPBodyElement[] soapBodyElements = createSOAPBodyElements( responseBodyElem );
+ for ( int j = 0; j < soapBodyElements.length; j++ )
+ {
+ SOAPBodyElement soapBodyElement = soapBodyElements[j];
+ responseBody.addChildElement( soapBodyElement );
+ }
+ }
+ }
+
+ if ( LOG.isDebugEnabled( ) )
+ {
+ LOG.debug( "Sending SOAP response: \n" + responseEnvelope );
+ }
+ }
+ catch ( Exception e )
+ {
+ handleException( e );
+ }
+
+ return false; // short-circuit any remaining Handlers in chain
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param handlerInfo DOCUMENT_ME
+ */
+ public void init( HandlerInfo handlerInfo )
+ {
+ Map handlerConfig = handlerInfo.getHandlerConfig( );
+ 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;
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param responseBodyElem DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ protected abstract SOAPBodyElement[] createSOAPBodyElements( XmlObject responseBodyElem );
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param resourceContext DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ protected Class getServiceClassName( ResourceContext resourceContext )
+ throws ResourceContextException,
+ ClassNotFoundException
+ {
+ String serviceClassName = resourceContext.getResourceHome( ).getServiceClassName( );
+ LOG.debug( MSG.getMessage( Keys.RETRIEVED_SERVICE_CLASSNAME, serviceClassName ) );
+ if ( serviceClassName == null )
+ {
+ throw new IllegalStateException( MSG.getMessage( Keys.SERVICE_OPT_UNDEFINED_IN_HOME,
+ SERVICE_OPT_SERVICE_CLASS_NAME ) );
+ }
+
+ return Class.forName( serviceClassName );
+ }
+
+ /**
+ * @param resourceContext
+ * @param key
+ *
+ * @return the service option string
+ */
+ protected final String getServiceOption( ResourceContext resourceContext,
+ String key )
+ {
+ return (String) resourceContext.getProperty( key );
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param soapMsgContext DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ protected SOAPEnvelope getResponseEnvelope( SOAPMessageContext soapMsgContext )
+ {
+ return ( getEnvelope( getResponseMessage( soapMsgContext ) ) );
+ }
+
+ /**
+ * @param soapMsgContext the response's JAX-RPC message context
+ *
+ * @return response JAX-RPC SOAP message
+ */
+ protected SOAPMessage getResponseMessage( SOAPMessageContext soapMsgContext )
+ {
+ SOAPMessage soapMsg = soapMsgContext.getMessage( );
+ if ( soapMsg == null )
+ {
+ soapMsg = createSOAPMessage( );
+ soapMsgContext.setMessage( soapMsg );
+ }
+
+ return ( soapMsg );
+ }
+
+ /**
+ * @param soapMsg a SAAJ SOAP message
+ *
+ * @return
+ */
+ private SOAPEnvelope getEnvelope( SOAPMessage soapMsg )
+ {
+ try
+ {
+ return soapMsg.getSOAPPart( ).getEnvelope( );
+ }
+ catch ( SOAPException soape )
+ {
+ throw new JAXRPCException( "Failed to get SOAPEnvelope from request SOAPMessage.", soape );
+ }
+ }
+
+ /**
+ * This method is used when there are no parameters to a method
+ *
+ * @param service The service to find the method on.
+ * @param methodNameFromAction The method name we are looking for.
+ *
+ * @return The Method object
+ */
+ private Method getServiceMethod( WsrfService service,
+ String methodNameFromAction )
+ {
+ Method serviceMethod = null;
+ LOG.debug( "Based on the request, looking for method named: " + methodNameFromAction + " in service "
+ + service.getClass( ).getName( ) + " with no params." );
+ Method[] methods = service.getClass( ).getMethods( );
+ for ( int i = 0; i < methods.length; i++ )
+ {
+ Method method = methods[i];
+ if ( method.getName( ).equals( methodNameFromAction ) )
+ {
+ if ( method.getParameterTypes( ).length == 0 )
+ {
+ serviceMethod = method;
+ break;
+ }
+ else
+ {
+ LOG.warn( "Found method named: " + methodNameFromAction + " in service "
+ + service.getClass( ).getName( ) + " with " + method.getParameterTypes( ).length
+ + " param types, expected 0 param type." );
+ }
+ }
+ }
+
+ if ( serviceMethod == null )
+ {
+ throw new RuntimeException( MSG.getMessage( Keys.BAD_REQUEST_BODY_ELEMENT,
+ methodNameFromAction,
+ service.getClass( ).getName( ) ) );
+ }
+
+ LOG.debug( MSG.getMessage( Keys.FOUND_SERVICE_METHOD,
+ serviceMethod.getName( ) ) );
+ return serviceMethod;
+ }
+
+ /**
+ * Finds the method based on the requestXBean name
+ *
+ * @param service
+ * @param requestXBean
+ *
+ * @return
+ */
+ private Method getServiceMethod( WsrfService service,
+ XmlObject requestXBean )
+ {
+ QName bodyElemName = XmlBeanUtils.getName( requestXBean );
+ if ( bodyElemName == null )
+ {
+ throw new FaultException( Soap1_1Constants.FAULT_CLIENT,
+ MSG.getMessage( Keys.BAD_REQUEST_BODY_ELEMENT_NOPARAM ) );
+ }
+
+ if ( LOG.isDebugEnabled( ) )
+ {
+ LOG.debug( MSG.getMessage( Keys.DERIVE_SERVICE_NAME_FROM_REQ,
+ toString( bodyElemName ) ) );
+ }
+
+ String serviceMethodName = service.getMethodNameMap( ).getMethodName( bodyElemName );
+ return getServiceMethod( service, serviceMethodName, requestXBean );
+ }
+
+ private Method getServiceMethod( WsrfService service,
+ String methodName,
+ XmlObject param )
+ {
+ Method serviceMethod = null;
+ LOG.debug( "Based on the request, looking for method named: " + methodName + " in service "
+ + service.getClass( ).getName( ) + " with a single param of type: "
+ + param.getClass( ).getName( ) );
+ Method[] methods = service.getClass( ).getMethods( );
+ for ( int i = 0; i < methods.length; i++ )
+ {
+ Method method = methods[i];
+ if ( method.getName( ).equals( methodName ) )
+ {
+ if ( method.getParameterTypes( ).length == 1 )
+ {
+ if ( method.getParameterTypes( )[0].isInstance( param ) )
+ {
+ serviceMethod = method;
+ break;
+ }
+ else
+ {
+ LOG.warn( "Found method named: " + methodName + " in service "
+ + service.getClass( ).getName( ) + " with a single param of type: "
+ + method.getParameterTypes( )[0].getName( )
+ + " , however the request param was of type: " + param.getClass( ).getName( ) );
+ }
+ }
+ else
+ {
+ LOG.warn( "Found method named: " + methodName + " in service " + service.getClass( ).getName( )
+ + " with " + method.getParameterTypes( ).length
+ + " params; expected method to have exactly one param." );
+ }
+ }
+ }
+
+ if ( serviceMethod == null ) // method not found
+ {
+ QName bodyElemName = XmlBeanUtils.getName( param );
+ throw new FaultException( Soap1_1Constants.FAULT_CLIENT,
+ MSG.getMessage( Keys.BAD_REQUEST_BODY_ELEMENT,
+ toString( bodyElemName ) ) );
+ }
+
+ LOG.debug( MSG.getMessage( Keys.FOUND_SERVICE_METHOD,
+ serviceMethod.getName( ) ) );
+ return serviceMethod;
+ }
+
+ /**
+ * Returns a facade-wrapped SOAPBody
+ *
+ * @param envelope
+ *
+ * @return a facade-wrapped SOAPBody
+ *
+ * @throws XmlException
+ */
+ private org.apache.ws.util.soap.Body getSoapBody( SOAPEnvelope envelope )
+ throws XmlException
+ {
+ org.apache.ws.util.soap.Envelope envelopeWrapper = null;
+ XmlObject envelopeDocXmlBean = XmlObject.Factory.parse( envelope.toString( ) );
+ if ( envelopeDocXmlBean instanceof org.w3.x2003.x05.soapEnvelope.EnvelopeDocument )
+ {
+ envelopeWrapper =
+ new org.apache.ws.util.soap.Envelope( (org.w3.x2003.x05.soapEnvelope.EnvelopeDocument) envelopeDocXmlBean );
+ }
+ else if ( envelopeDocXmlBean instanceof org.xmlsoap.schemas.soap.envelope.EnvelopeDocument )
+ {
+ envelopeWrapper =
+ new org.apache.ws.util.soap.Envelope( (org.xmlsoap.schemas.soap.envelope.EnvelopeDocument) envelopeDocXmlBean );
+ }
+ else
+ {
+ throw new IllegalArgumentException( "Unknown version of SOAPEnvelope: "
+ + envelopeDocXmlBean.getClass( ).getName( ) );
+ }
+
+ return envelopeWrapper.getBody( );
+ }
+
+ private void handleException( Exception e )
+ {
+ if ( e instanceof SOAPFaultException )
+ {
+ throw (SOAPFaultException) e;
+ }
+ else
+ {
+ if ( LOG.isDebugEnabled( ) )
+ {
+ LOG.debug( MSG.getMessage( Keys.INTERNAL_SERVER_ERROR ) );
+ e.printStackTrace( );
+ }
+
+ throw new FaultException( Soap1_1Constants.FAULT_SERVER,
+ MSG.getMessage( Keys.INTERNAL_SERVER_ERROR ) );
+ }
+ }
+
+ private XmlObject invokeServiceMethod( Method serviceMethod,
+ WsrfService service,
+ XmlObject requestXBean,
+ Class serviceClass )
+ throws Exception
+ {
+ XmlObject responseXBean = null;
+ Object[] params = toObjectArray( requestXBean );
+ try
+ {
+ responseXBean = (XmlObject) serviceMethod.invoke( service, params );
+ }
+ catch ( InvocationTargetException ite )
+ {
+ if ( LOG.isDebugEnabled( ) )
+ {
+ LOG.debug( MSG.getMessage( Keys.ERROR_INVOKING_METHOD_ON_SERVICE,
+ serviceMethod.getName( ),
+ serviceClass.getName( ) ) );
+ if ( ite.getCause( ) != null )
+ {
+ ite.getCause( ).printStackTrace( );
+ }
+ }
+
+ if ( ite.getCause( ) != null )
+ {
+ throw (Exception) ite.getCause( );
+ }
+ else
+ {
+ throw ite;
+ }
+ }
+
+ if ( ( responseXBean == null ) && ( serviceMethod.getReturnType( ) != void.class ) )
+ {
+ // don't allow service method to return null
+ LOG.error( "Service method " + serviceMethod.getName( ) + " in class " + serviceClass.getName( )
+ + " returned null - this is not allowed." );
+ throw new IllegalStateException( );
+ }
+
+ return responseXBean;
+ }
+
+ private XmlObject toDocumentXmlBean( XmlObject xBean )
+ throws XmlException
+ {
+ // TODO (performance): probably should change method signatures to take types instead of documents to avoid this
+ return XmlObject.Factory.parse( xBean.xmlText( new XmlOptions( ).setSaveOuter( ) ) );
+ }
+
+ private Object[] toObjectArray( Object obj )
+ {
+ return ( obj != null ) ? new Object[]
+ {
+ obj
+ } : new Object[0];
+ }
+
+ private static String toString( QName name )
+ {
+ StringBuffer strBuf = new StringBuffer( );
+ strBuf.append( name.getLocalPart( ) );
+ if ( name.getNamespaceURI( ) != null )
+ {
+ strBuf.append( "@" );
+ strBuf.append( name.getNamespaceURI( ) );
+ }
+
+ return strBuf.toString( );
+ }
+
+ private String getHandlerOption( String optionName,
+ String defaultValue )
+ {
+ Object value = ( m_handlerOptions != null ) ? m_handlerOptions.get( optionName ) : null;
+ return ( value != null ) ? value.toString( ) : defaultValue;
+ }
+
+ private SOAPMessage createSOAPMessage( )
+ {
+ try
+ {
+ return MessageFactory.newInstance( ).createMessage( );
+ }
+ catch ( SOAPException soape )
+ {
+ throw new JAXRPCException( MSG.getMessage( Keys.FAILED_TO_CREATE_SOAPMESSAGE ), soape );
+ }
+ }
+
+ private WsrfService createService( Class serviceClass,
+ ResourceContext resourceContext )
+ throws Exception
+ {
+ LOG.debug( MSG.getMessage( Keys.CREATING_INSTANCE_OF_SERVICE, serviceClass ) );
+ Constructor serviceCtor = serviceClass.getConstructor( new Class[]
+ {
+ ResourceContext.class
+ } );
+ WsrfService service = null;
+ try
+ {
+ service = (WsrfService) serviceCtor.newInstance( new Object[]
+ {
+ resourceContext
+ } );
+ }
+ catch ( InvocationTargetException ite )
+ {
+ throw (Exception) ite.getCause( );
+ }
+
+ return service;
+ }
+
+ private void validateRequestXml( XmlObject requestXBean )
+ {
+ boolean validateRequestXml =
+ Boolean.valueOf( getHandlerOption( HANDLER_OPT_VALIDATE_REQUEST_XML, "true" ) ).booleanValue( );
+ if ( validateRequestXml && !( requestXBean instanceof XmlAnyTypeImpl ) )
+ {
+ XmlOptions validateOptions = new XmlOptions( );
+ List errorList = new ArrayList( );
+ validateOptions.setErrorListener( errorList );
+ boolean isValid = requestXBean.validate( validateOptions );
+ if ( !isValid )
+ {
+ QName bodyElemName = XmlBeanUtils.getName( requestXBean );
+ StringBuffer strBuf = new StringBuffer( "Request body element " );
+ strBuf.append( toString( bodyElemName ) );
+ strBuf.append( " is not valid as per its schema: \n\n" );
+ for ( int i = 0; i < errorList.size( ); i++ )
+ {
+ strBuf.append( "\t\t" );
+ strBuf.append( i + 1 );
+ strBuf.append( ") " );
+ strBuf.append( errorList.get( i ) );
+ strBuf.append( "\n" );
+ }
+
+ strBuf.append( "\n" );
+ throw new FaultException( Soap1_1Constants.FAULT_CLIENT,
+ strBuf.toString( ) );
+ }
+ }
+ }
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/resource/handler/ServiceSoapMethodNameMap.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/resource/handler/ServiceSoapMethodNameMap.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/resource/handler/ServiceSoapMethodNameMap.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/resource/handler/ServiceSoapMethodNameMap.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,95 @@
+/*=============================================================================*
+ * 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.handler;
+
+import org.apache.commons.lang.StringUtils;
+import org.apache.ws.resource.ResourceContext;
+import javax.xml.namespace.QName;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * LOG-DONE
+ * @author Sal Campana
+ */
+public class ServiceSoapMethodNameMap
+ extends AbstractSoapMethodNameMap
+{
+ private Map m_RequestQnameToMethodNameMap;
+
+ /**
+ * Creates a new {@link ServiceSoapMethodNameMap} object.
+ *
+ * @param context DOCUMENT_ME
+ */
+ public ServiceSoapMethodNameMap( ResourceContext context )
+ {
+ m_RequestQnameToMethodNameMap = new HashMap( );
+ setParent( new DefaultMethodMap( new WsddSoapMethodNameMap( context ) ) );
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param request DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public String getDefaultMethodName( QName request )
+ {
+ String methodName = (String) m_RequestQnameToMethodNameMap.get( request );
+ if ( methodName == null )
+ {
+ methodName = StringUtils.uncapitalize( request.getLocalPart( ) );
+ }
+
+ return methodName;
+ }
+
+ /**
+ * Adds a mapping for a SOAP Message to Java Method name
+ *
+ * @param soapMsgQname
+ * @param javaMethodName
+ */
+ public void addMapping( QName soapMsgQname,
+ String javaMethodName )
+ {
+ m_RequestQnameToMethodNameMap.put( soapMsgQname, javaMethodName );
+ }
+
+ /**
+ * Returns a Default name for a method based on a request's WS-Addressing Action Header.
+ *
+ * @param action String representation of WS-Addressing Action Header Value
+ * @return The name of the operation OR null if there is no Action registered.
+ */
+ public String lookupMethodNameFromAction( String action )
+ {
+ String methodName = (String) m_RequestQnameToMethodNameMap.get( action );
+ return methodName;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param soapMsgQname DOCUMENT_ME
+ */
+ public void removeMapping( QName soapMsgQname )
+ {
+ m_RequestQnameToMethodNameMap.remove( soapMsgQname );
+ }
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/resource/handler/SoapMethodNameMap.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/resource/handler/SoapMethodNameMap.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/resource/handler/SoapMethodNameMap.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/resource/handler/SoapMethodNameMap.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,59 @@
+/*=============================================================================*
+ * 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.handler;
+
+import javax.xml.namespace.QName;
+
+/**
+ * This is an interface with is meant to be implemented by the generated Abstract class. This provides the operation to
+ * "look-up" a method name based on the incoming request.
+ *
+ * @author Sal Campana
+ */
+public interface SoapMethodNameMap
+{
+ /**
+ * DOCUMENT_ME
+ *
+ * @param requestName DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public String getMethodName( QName requestName );
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param action DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public String getMethodNameFromAction( String action );
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param parent DOCUMENT_ME
+ */
+ public void setParent( SoapMethodNameMap parent );
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public SoapMethodNameMap getParent( );
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/resource/handler/WsddSoapMethodNameMap.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/resource/handler/WsddSoapMethodNameMap.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/resource/handler/WsddSoapMethodNameMap.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/resource/handler/WsddSoapMethodNameMap.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,60 @@
+/*=============================================================================*
+ * 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.handler;
+
+import org.apache.ws.resource.ResourceContext;
+import javax.xml.namespace.QName;
+
+/**
+ * @author Sal Campana
+ */
+public class WsddSoapMethodNameMap
+ extends AbstractSoapMethodNameMap
+{
+ private ResourceContext m_resourceContext;
+
+ /**
+ * Creates a new {@link WsddSoapMethodNameMap} object.
+ *
+ * @param context DOCUMENT_ME
+ */
+ public WsddSoapMethodNameMap( ResourceContext context )
+ {
+ m_resourceContext = context;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param request DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public String getDefaultMethodName( QName request )
+ {
+ return (String) m_resourceContext.getProperty( request.toString( ) );
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public SoapMethodNameMap getParent( )
+ {
+ return null;
+ }
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/resource/handler/WsrfService.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/resource/handler/WsrfService.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/resource/handler/WsrfService.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/resource/handler/WsrfService.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,49 @@
+/*=============================================================================*
+ * 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.handler;
+
+import org.apache.ws.resource.ResourceContext;
+
+/**
+ * Interface to be implemented by the Service implementation, either Abstract
+ * or concrete. Provides methods for initialization, obtaining the ResourceContext
+ * and getting the SoapMethodNameMap use for mapping incoming request QName's to
+ * method name for a given object.
+ *
+ * @author Sal Campana
+ */
+public interface WsrfService
+{
+ /**
+ * Returns the SoapMethodNameMap for the Service, to determine
+ * which method to invoke for an incoming request.
+ *
+ * @return SoapMethodNameMap
+ */
+ public SoapMethodNameMap getMethodNameMap( );
+
+ /**
+ * Returns the ResourceContext for the given Service.
+ *
+ * @return ResourceContext
+ */
+ public ResourceContext getResourceContext( );
+
+ /**
+ * Initialization method.
+ */
+ public void init( );
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/resource/handler/axis/AxisResourceContext.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/resource/handler/axis/AxisResourceContext.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/resource/handler/axis/AxisResourceContext.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/resource/handler/axis/AxisResourceContext.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,113 @@
+/*=============================================================================*
+ * 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.handler.axis;
+
+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.util.i18n.Messages;
+import javax.xml.rpc.handler.MessageContext;
+import javax.xml.rpc.handler.soap.SOAPMessageContext;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Hashtable;
+import java.util.Iterator;
+
+/**
+ * Axis version of a ResourceContext.
+ *
+ * @author Sal Campana
+ * @author Ian Springer
+ */
+public class AxisResourceContext
+ extends AbstractResourceContext
+{
+ //private static final Log LOG = LogFactory.getLog( AxisResourceContext.class.getName( ) );
+ private static final Messages MSG = MessagesImpl.getInstance( );
+
+ /**
+ * Creates a new {@link AxisResourceContext} object.
+ *
+ * @param msgContext SOAPMessageContext
+ */
+ public AxisResourceContext( SOAPMessageContext msgContext )
+ throws Exception
+ {
+ super( msgContext );
+ importServiceOptions( msgContext );
+ }
+
+ /**
+ * Returns the Service name from the Axis MessageContext {@link org.apache.axis.MessageContext#getTargetService()}
+ *
+ * @param msgContext Jax-RPC MessageContext
+ *
+ * @return The service name
+ */
+ protected String getServiceName( MessageContext msgContext )
+ {
+ if ( msgContext == null )
+ {
+ throw new IllegalArgumentException( MSG.getMessage( Keys.MESSAGECONTEXT_NULL ) );
+ }
+
+ org.apache.axis.MessageContext axisMsgContext = (org.apache.axis.MessageContext) msgContext;
+ return axisMsgContext.getTargetService( );
+ }
+
+ /**
+ * Returns the Service url from the Axis MessageContext {@link org.apache.axis.MessageContext#getProperty(String)}
+ * passing it {@link org.apache.axis.MessageContext#TRANS_URL}
+ *
+ * @param msgContext Jax-RPC MessageContext
+ *
+ * @return The service URL
+ */
+ protected URL getServiceURL( MessageContext msgContext )
+ {
+ if ( msgContext == null )
+ {
+ throw new IllegalArgumentException( "Null parameter: msgContext" );
+ }
+
+ org.apache.axis.MessageContext axisMsgContext = (org.apache.axis.MessageContext) msgContext;
+ try
+ {
+ return new URL( (String) axisMsgContext.getProperty( org.apache.axis.MessageContext.TRANS_URL ) );
+ }
+ catch ( MalformedURLException murle )
+ {
+ throw new RuntimeException( "Value of Axis " + org.apache.axis.MessageContext.TRANS_URL
+ + " MessageContext property is not a valid URL.", murle );
+ }
+ }
+
+ private void importServiceOptions( MessageContext msgContext )
+ {
+ org.apache.axis.MessageContext axisMsgContext = (org.apache.axis.MessageContext) msgContext;
+ SOAPService service = axisMsgContext.getService( );
+ Hashtable options = service.getOptions( );
+ Iterator iterator = options.keySet( ).iterator( );
+
+ while ( iterator.hasNext( ) )
+ {
+ String key = (String) iterator.next( );
+ setProperty( key,
+ service.getOption( key ) );
+ }
+ }
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/resource/handler/axis/GenericAxisHandler.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/resource/handler/axis/GenericAxisHandler.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/resource/handler/axis/GenericAxisHandler.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/resource/handler/axis/GenericAxisHandler.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,83 @@
+/*=============================================================================*
+ * 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.handler.axis;
+
+import org.apache.axis.AxisFault;
+import org.apache.axis.handlers.BasicHandler;
+import javax.xml.namespace.QName;
+import javax.xml.rpc.handler.Handler;
+import javax.xml.rpc.handler.HandlerInfo;
+
+/**
+ * An Axis handler that serves as a facade for a JAX-RPC handler.
+ *
+ * @author Ian Springer
+ */
+public class GenericAxisHandler
+ extends BasicHandler
+{
+ private Handler jaxRpcHandler;
+
+ /**
+ * Creates a new {@link GenericAxisHandler} object.
+ *
+ * @param handler DOCUMENT_ME
+ */
+ public GenericAxisHandler( Handler handler )
+ {
+ jaxRpcHandler = handler;
+ }
+
+ /**
+ * Impl of {@link org.apache.axis.Handler#init()} that delegates to JAX-RPC {@link
+ * Handler#init(javax.xml.rpc.handler.HandlerInfo)}.
+ */
+ public void init( )
+ {
+ HandlerInfo handlerInfo = new HandlerInfo( jaxRpcHandler.getClass( ),
+ getOptions( ),
+ new QName[0] );
+ jaxRpcHandler.init( handlerInfo );
+ }
+
+ /**
+ * Impl of {@link org.apache.axis.Handler#invoke(org.apache.axis.MessageContext)} that delegates to either JAX-RPC
+ * {@link Handler#handleRequest(javax.xml.rpc.handler.MessageContext)} or JAX-RPC {@link
+ * Handler#handleResponse(javax.xml.rpc.handler.MessageContext)}, depending upon whether the handler chain pivot has
+ * been passed yet or not.
+ */
+ public void invoke( org.apache.axis.MessageContext msgContext )
+ throws AxisFault
+ {
+ if ( !msgContext.getPastPivot( ) )
+ {
+ jaxRpcHandler.handleRequest( msgContext );
+ }
+ else
+ {
+ jaxRpcHandler.handleResponse( msgContext );
+ }
+ }
+
+ /**
+ * Impl of {@link org.apache.axis.Handler#onFault(org.apache.axis.MessageContext)} that delegates to JAX-RPC {@link
+ * Handler#handleFault(javax.xml.rpc.handler.MessageContext)}.
+ */
+ public void onFault( org.apache.axis.MessageContext msgContext )
+ {
+ jaxRpcHandler.handleFault( msgContext );
+ }
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/resource/handler/axis/ResourceProvider.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/resource/handler/axis/ResourceProvider.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/resource/handler/axis/ResourceProvider.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/resource/handler/axis/ResourceProvider.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,329 @@
+/*=============================================================================*
+ * 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.handler.axis;
+
+import org.apache.axis.AxisFault;
+import org.apache.axis.Constants;
+import org.apache.axis.Handler;
+import org.apache.axis.Message;
+import org.apache.axis.MessageContext;
+import org.apache.axis.encoding.SerializationContext;
+import org.apache.axis.handlers.soap.SOAPService;
+import org.apache.axis.message.SOAPEnvelope;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.ws.resource.ResourceContext;
+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.util.i18n.Messages;
+import org.apache.xmlbeans.XmlObject;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import javax.xml.namespace.QName;
+import javax.xml.rpc.handler.soap.SOAPMessageContext;
+import javax.xml.soap.SOAPBodyElement;
+import javax.xml.soap.SOAPMessage;
+import java.io.StringWriter;
+import java.io.Writer;
+import java.util.ArrayList;
+import java.util.Hashtable;
+import java.util.List;
+
+/**
+ * LOG-DONE Axis provider that dispatches requests to WS-Resources.
+ *
+ * @author Ian Springer, Sal Campana
+ */
+public class ResourceProvider
+ extends ResourceHandler
+ implements Handler
+{
+ private static final Log LOG = LogFactory.getLog( ResourceProvider.class );
+ private static final Messages MSG = MessagesImpl.getInstance( );
+
+ /** DOCUMENT_ME */
+ public static final String SYSPROP_AXIS_FAULT_DEBUG = "axis.fault.debug";
+ private GenericAxisHandler m_axisHelperHandler = new GenericAxisHandler( this );
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param doc DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public Element getDeploymentData( Document doc )
+ {
+ return m_axisHelperHandler.getDeploymentData( doc );
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param name DOCUMENT_ME
+ */
+ public void setName( String name )
+ {
+ m_axisHelperHandler.setName( name );
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public String getName( )
+ {
+ return m_axisHelperHandler.getName( );
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param name DOCUMENT_ME
+ * @param value DOCUMENT_ME
+ */
+ public void setOption( String name,
+ Object value )
+ {
+ m_axisHelperHandler.setOption( name, value );
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param name DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public Object getOption( String name )
+ {
+ return m_axisHelperHandler.getOption( name );
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param opts DOCUMENT_ME
+ */
+ public void setOptions( Hashtable opts )
+ {
+ m_axisHelperHandler.setOptions( opts );
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public Hashtable getOptions( )
+ {
+ return m_axisHelperHandler.getOptions( );
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public List getUnderstoodHeaders( )
+ {
+ return m_axisHelperHandler.getUnderstoodHeaders( );
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param qname DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public boolean canHandleBlock( QName qname )
+ {
+ return m_axisHelperHandler.canHandleBlock( qname );
+ }
+
+ /**
+ * DOCUMENT_ME
+ */
+ public void cleanup( )
+ {
+ m_axisHelperHandler.cleanup( );
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param msgContext DOCUMENT_ME
+ *
+ * @throws AxisFault DOCUMENT_ME
+ */
+ public void generateWSDL( MessageContext msgContext )
+ throws AxisFault
+ {
+ SOAPService service = msgContext.getService( );
+ LOG.debug( MSG.getMessage( Keys.RECEIVED_WSDL_REQUEST,
+ service.getName( ) ) );
+ service.generateWSDL( msgContext );
+ }
+
+ /**
+ * DOCUMENT_ME
+ */
+ public void init( )
+ {
+ m_axisHelperHandler.setOptions( getOptions( ) );
+ m_axisHelperHandler.init( );
+ }
+
+ /**
+ * Invokes a Web service operation.
+ *
+ * @param msgContext Axis SOAP message context
+ *
+ * @throws AxisFault if a SOAP fault needs to be returned to the client
+ */
+ public void invoke( MessageContext msgContext )
+ throws AxisFault
+ {
+ try
+ {
+ try
+ {
+ handleRequest( msgContext );
+ handleResponse( msgContext );
+ }
+ catch ( RuntimeException re )
+ {
+ throw AxisFault.makeFault( re );
+ }
+ }
+ catch ( AxisFault axisFault )
+ {
+ // only include hostname and stack trace in fault Detail if sysprop axis.fault.debug="true"
+ if ( !Boolean.getBoolean( SYSPROP_AXIS_FAULT_DEBUG ) )
+ {
+ axisFault.removeHostname( );
+ axisFault.removeFaultDetail( Constants.QNAME_FAULTDETAIL_STACKTRACE );
+ }
+
+ if ( LOG.isDebugEnabled( ) )
+ {
+ try
+ {
+ LOG.debug( "Sending SOAP fault: \n" + toXML( axisFault, msgContext ) );
+ }
+ catch ( Exception e )
+ {
+ LOG.error( "Failed to serialize AxisFault: " + e );
+ }
+ }
+
+ throw axisFault;
+ }
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param msgContext DOCUMENT_ME
+ */
+ public void onFault( MessageContext msgContext )
+ {
+ m_axisHelperHandler.onFault( msgContext );
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param soapMsgContext DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ protected SOAPMessage getResponseMessage( SOAPMessageContext soapMsgContext )
+ {
+ MessageContext axisMsgContext = ( (MessageContext) soapMsgContext );
+ Message responseMsg = axisMsgContext.getResponseMessage( );
+ if ( responseMsg == null )
+ {
+ responseMsg = createMessage( axisMsgContext );
+ axisMsgContext.setResponseMessage( responseMsg );
+ }
+
+ return responseMsg;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param soapMsgContext DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ protected ResourceContext createResourceContext( SOAPMessageContext soapMsgContext )
+ throws Exception
+ {
+ return new AxisResourceContext( soapMsgContext );
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param responseBodyElem DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ protected SOAPBodyElement[] createSOAPBodyElements( XmlObject responseBodyElem )
+ {
+ List bodyElems = new ArrayList( );
+ Node node = responseBodyElem.newDomNode( );
+ 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 )
+ {
+ bodyElems.add( new org.apache.axis.message.SOAPBodyElement( (Element) child ) );
+ }
+ }
+
+ return (SOAPBodyElement[]) bodyElems.toArray( new SOAPBodyElement[0] );
+ }
+
+ private Message createMessage( MessageContext axisMsgContext )
+ {
+ SOAPEnvelope envelope =
+ new SOAPEnvelope( axisMsgContext.getSOAPConstants( ),
+ axisMsgContext.getSchemaVersion( ) );
+ return new Message( envelope );
+ }
+
+ private String toXML( AxisFault axisFault,
+ MessageContext msgContext )
+ throws Exception
+ {
+ Writer writer = new StringWriter( );
+ axisFault.output( new SerializationContext( writer, msgContext ) );
+ String xml = writer.toString( );
+ writer.close( );
+ return xml;
+ }
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/resource/handler/axis/ResourceProviderFactory.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/resource/handler/axis/ResourceProviderFactory.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/resource/handler/axis/ResourceProviderFactory.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/resource/handler/axis/ResourceProviderFactory.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,57 @@
+/*=============================================================================*
+ * 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.handler.axis;
+
+import org.apache.axis.EngineConfiguration;
+import org.apache.axis.Handler;
+import org.apache.axis.deployment.wsdd.WSDDProvider;
+import org.apache.axis.deployment.wsdd.WSDDService;
+
+/**
+ * An Axis {@link WSDDProvider} that acts as a factory for {@link ResourceProvider}
+ * instances.
+ *
+ * @author Sal Campana, Ian Springer
+ */
+public class ResourceProviderFactory
+ extends WSDDProvider
+{
+ /**
+ * Provider Name for use in the server-config.wsdd file (e.g. provider="java:WSRF").
+ */
+ public static final String PROVIDER_NAME = "WSRF";
+
+ /**
+ * @see WSDDProvider#getName()
+ */
+ public String getName( )
+ {
+ return PROVIDER_NAME;
+ }
+
+ /**
+ * @see WSDDProvider#newProviderInstance(WSDDService, EngineConfiguration)
+ */
+ public Handler newProviderInstance( WSDDService service,
+ EngineConfiguration registry )
+ throws Exception
+ {
+ ResourceProvider resourceProvider = new ResourceProvider( );
+ resourceProvider.setOptions( System.getProperties( ) );
+ resourceProvider.init( );
+ return resourceProvider;
+ }
+}
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: muse-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-commits-help@ws.apache.org