/*=============================================================================*
* 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.util.platform.websphere;
import org.apache.ws.resource.ResourceContext;
import org.apache.ws.resource.handler.websphere.WASResourceContext;
import org.apache.ws.util.platform.JaxRpcPlatform;
import javax.xml.rpc.handler.soap.SOAPMessageContext;
/**
* @author Sal Campana
*/
public class WebsphereJaxRpcPlatform
extends JaxRpcPlatform
{
/**
* Websphere description.
*/
private static final String WEBSPHERE_DESC = "BEA WebLogic Server";
/**
* Class name of Websphere's impl of SAAJ {@link javax.xml.soap.SOAPFactory} interface.
*/
private static final String IMPL_SOAP_FACTORY_WEBSPHERE = "com.ibm.ws.webservices.engine.xmlsoap.SOAPFactory";
/**
* Returns a short description of the platform.
*
* @return a short description of the platform
*/
public String getDescription( )
{
return WEBSPHERE_DESC;
}
/**
* Returns the platform-specific endpoint url for a service on a given platform.
* <p/>
* An example of this would be:</br>
* baseWebappUrl = http://localhost:8080/wsrf</br>
* serviceName = filesystem</br>
* <p/>
* On the Axis platform the endpoint URL is: http://localhost:8080/wsrf/services/filesystem
*
* @param baseWebappUrl The url containing the webapp context (i.e. http://localhost:8080/wsrf)
* @param serviceName The service name which is registered with the platform
* @return The endpoint url for the service.
*/
public String getEndpointUrl( String baseWebappUrl,
String serviceName )
{
return baseWebappUrl + "/" + serviceName;
}
/**
* Returns the SOAPFactoryImpl class name.
*
* @return SOAPFactoryImpl class name.
*/
public String getSoapFactoryImpl( )
{
return IMPL_SOAP_FACTORY_WEBSPHERE;
}
/**
* 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 WASResourceContext( soapMsgContext );
}
/**
* Returns the description of the JAX-RPC platform.
*
* @return String
*/
public String toString( )
{
return WEBSPHERE_DESC;
}
}