org.apache.axis.MessageContext.getService()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(12.4k)|赞(0)|评价(0)|浏览(97)

本文整理了Java中org.apache.axis.MessageContext.getService()方法的一些代码示例,展示了MessageContext.getService()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MessageContext.getService()方法的具体详情如下:
包路径:org.apache.axis.MessageContext
类名称:MessageContext
方法名:getService

MessageContext.getService介绍

[英]Get the SOAPService used to handle services in this context.
[中]获取用于在此上下文中处理服务的SOAPService

代码示例

代码示例来源:origin: axis/axis

private int getSendType() {
  int sendType = Attachments.SEND_TYPE_NOTSET;
  if ((msgContext != null) && (msgContext.getService() != null)) {
    sendType = msgContext.getService().getSendType();
  }
  return sendType;
}

代码示例来源:origin: org.apache.axis/com.springsource.org.apache.axis

private int getSendType() {
  int sendType = Attachments.SEND_TYPE_NOTSET;
  if ((msgContext != null) && (msgContext.getService() != null)) {
    sendType = msgContext.getService().getSendType();
  }
  return sendType;
}

代码示例来源:origin: org.apache.axis/axis

private int getSendType() {
  int sendType = Attachments.SEND_TYPE_NOTSET;
  if ((msgContext != null) && (msgContext.getService() != null)) {
    sendType = msgContext.getService().getSendType();
  }
  return sendType;
}

代码示例来源:origin: axis/axis

public void invoke(MessageContext msgContext) throws AxisFault
{
  log.debug("Enter: URLMapper::invoke");
  /** If there's already a targetService then just return.
   */
  if ( msgContext.getService() == null ) {
    // path may or may not start with a "/". see http://issues.apache.org/jira/browse/AXIS-1372
    String path = (String)msgContext.getProperty(HTTPConstants.MC_HTTP_SERVLETPATHINFO);
    if ((path != null) && (path.length() >= 1)) { //rules out the cases of path="", path=null
      if(path.startsWith("/"))
        path = path.substring(1); //chop the extra "/"            		
      msgContext.setTargetService( path );
    }
  }
  log.debug("Exit: URLMapper::invoke");
}

代码示例来源:origin: org.apache.axis/axis

public void invoke(MessageContext msgContext) throws AxisFault
{
  log.debug("Enter: URLMapper::invoke");
  /** If there's already a targetService then just return.
   */
  if ( msgContext.getService() == null ) {
    // path may or may not start with a "/". see http://issues.apache.org/jira/browse/AXIS-1372
    String path = (String)msgContext.getProperty(HTTPConstants.MC_HTTP_SERVLETPATHINFO);
    if ((path != null) && (path.length() >= 1)) { //rules out the cases of path="", path=null
      if(path.startsWith("/"))
        path = path.substring(1); //chop the extra "/"            		
      msgContext.setTargetService( path );
    }
  }
  log.debug("Exit: URLMapper::invoke");
}

代码示例来源:origin: org.apache.axis/com.springsource.org.apache.axis

public void invoke(MessageContext msgContext) throws AxisFault
{
  log.debug("Enter: URLMapper::invoke");
  /** If there's already a targetService then just return.
   */
  if ( msgContext.getService() == null ) {
    // path may or may not start with a "/". see http://issues.apache.org/jira/browse/AXIS-1372
    String path = (String)msgContext.getProperty(HTTPConstants.MC_HTTP_SERVLETPATHINFO);
    if ((path != null) && (path.length() >= 1)) { //rules out the cases of path="", path=null
      if(path.startsWith("/"))
        path = path.substring(1); //chop the extra "/"            		
      msgContext.setTargetService( path );
    }
  }
  log.debug("Exit: URLMapper::invoke");
}

代码示例来源:origin: axis/axis

/**
 * Create an EJB using a remote home object
 * 
 * @param msgContext the message context
 * @param beanJndiName The JNDI name of the EJB remote home class
 * @param homeClass the class of the home interface
 * @return an EJB
 */
private Object createRemoteEJB(MessageContext msgContext, 
                String beanJndiName,
                Class homeClass)
  throws Exception
{
  // Get the EJB Home object from JNDI 
  Object ejbHome = getEJBHome(msgContext.getService(),
                msgContext, beanJndiName);
  Object ehome = javax.rmi.PortableRemoteObject.narrow(ejbHome, homeClass);
  // Invoke the create method of the ejbHome class without actually
  // touching any EJB classes (i.e. no cast to EJBHome)
  Method createMethod = homeClass.getMethod("create", empty_class_array);
  Object result = createMethod.invoke(ehome, empty_object_array);
  
  return result;        
}

代码示例来源:origin: org.apache.axis/com.springsource.org.apache.axis

/**
 * Create an EJB using a remote home object
 * 
 * @param msgContext the message context
 * @param beanJndiName The JNDI name of the EJB remote home class
 * @param homeClass the class of the home interface
 * @return an EJB
 */
private Object createRemoteEJB(MessageContext msgContext, 
                String beanJndiName,
                Class homeClass)
  throws Exception
{
  // Get the EJB Home object from JNDI 
  Object ejbHome = getEJBHome(msgContext.getService(),
                msgContext, beanJndiName);
  Object ehome = javax.rmi.PortableRemoteObject.narrow(ejbHome, homeClass);
  // Invoke the create method of the ejbHome class without actually
  // touching any EJB classes (i.e. no cast to EJBHome)
  Method createMethod = homeClass.getMethod("create", empty_class_array);
  Object result = createMethod.invoke(ehome, empty_object_array);
  
  return result;        
}

代码示例来源:origin: org.apache.axis/axis

/**
 * Create an EJB using a remote home object
 * 
 * @param msgContext the message context
 * @param beanJndiName The JNDI name of the EJB remote home class
 * @param homeClass the class of the home interface
 * @return an EJB
 */
private Object createRemoteEJB(MessageContext msgContext, 
                String beanJndiName,
                Class homeClass)
  throws Exception
{
  // Get the EJB Home object from JNDI 
  Object ejbHome = getEJBHome(msgContext.getService(),
                msgContext, beanJndiName);
  Object ehome = javax.rmi.PortableRemoteObject.narrow(ejbHome, homeClass);
  // Invoke the create method of the ejbHome class without actually
  // touching any EJB classes (i.e. no cast to EJBHome)
  Method createMethod = homeClass.getMethod("create", empty_class_array);
  Object result = createMethod.invoke(ehome, empty_object_array);
  
  return result;        
}

代码示例来源:origin: org.apache.axis/axis

/**
 * Return a object which implements the service.
 * 
 * @param msgContext the message context
 * @param clsName The JNDI name of the EJB home class
 * @return an object that implements the service
 */
protected Object makeNewServiceObject(MessageContext msgContext,
                   String clsName)
    throws Exception {
  // Read deployment descriptor options
  String namingLookup = getStrOption(OPTION_NAMING_LOOKUP, msgContext.getService());
  if (System.getSecurityManager() == null) {
    System.setSecurityManager(new RMISecurityManager());
  }
  Object targetObject = Naming.lookup(namingLookup);
  return targetObject;
}

代码示例来源:origin: axis/axis

/**
 * Return a object which implements the service.
 * 
 * @param msgContext the message context
 * @param clsName The JNDI name of the EJB home class
 * @return an object that implements the service
 */
protected Object makeNewServiceObject(MessageContext msgContext,
                   String clsName)
    throws Exception {
  // Read deployment descriptor options
  String namingLookup = getStrOption(OPTION_NAMING_LOOKUP, msgContext.getService());
  if (System.getSecurityManager() == null) {
    System.setSecurityManager(new RMISecurityManager());
  }
  Object targetObject = Naming.lookup(namingLookup);
  return targetObject;
}

代码示例来源:origin: org.apache.axis/com.springsource.org.apache.axis

/**
 * Return a object which implements the service.
 * 
 * @param msgContext the message context
 * @param clsName The JNDI name of the EJB home class
 * @return an object that implements the service
 */
protected Object makeNewServiceObject(MessageContext msgContext,
                   String clsName)
    throws Exception {
  // Read deployment descriptor options
  String namingLookup = getStrOption(OPTION_NAMING_LOOKUP, msgContext.getService());
  if (System.getSecurityManager() == null) {
    System.setSecurityManager(new RMISecurityManager());
  }
  Object targetObject = Naming.lookup(namingLookup);
  return targetObject;
}

代码示例来源:origin: org.ow2.orchestra/orchestra-axis

@Override
public void invoke(final MessageContext msgContext) throws AxisFault {
 // Make sure that the method style is correctly set (This does not appear to
 // be handled by default)
 this.setOperationStyle(msgContext);
 // Set the msgClassLoader
 final String endpointName = msgContext.getService().getName();
 final WebServiceClassLoader cl = ClassLoaderMap.getCL(endpointName);
 msgContext.setClassLoader(cl);
 final ClassLoader old = Thread.currentThread().getContextClassLoader();
 try {
  Thread.currentThread().setContextClassLoader(cl.getOrchestraClassLoader());
  super.invoke(msgContext);
 } finally {
  Thread.currentThread().setContextClassLoader(old);
 }
}

代码示例来源:origin: org.astrogrid/astrogrid-cea-server

/**
* 
*/
public CommonExecutionConnectorServiceSoapBindingImpl() {
 try {
      ServiceDesc servicedesc = org.apache.axis.MessageContext.getCurrentContext().getService().getServiceDescription();
   cec = CEAComponentContainer.getInstance().getExecutionController();
  
   //nController(servicedesc);
 }
 catch (Throwable e) {         
   logger.fatal("problem instatiating applicationController", e);
   //we're stuffed - no point continuing.
   throw new RuntimeException("Could not instantiate application controller",e);
 }
 try {
   query = CEAComponentContainer.getInstance().getQueryService();
 } catch (Throwable e) {
   logger.fatal("problem instantiating querier",e);
   throw new RuntimeException("Could not instantiate query service",e);
 }
 
}

代码示例来源:origin: org.apache.axis/axis

/**
 * isDotNetSoapEncFixNeeded - Do we need to compensate for the dotnet bug.
 * check the service specific flag before using the global flag
 * @return
 */
private boolean isDotNetSoapEncFixNeeded() {
  MessageContext msgContext = MessageContext.getCurrentContext();
  if (msgContext != null) {
    SOAPService service = msgContext.getService();
    if (service != null) {
      String dotNetSoapEncFix = (String) service.getOption(AxisEngine.PROP_DOTNET_SOAPENC_FIX);
      if (dotNetSoapEncFix != null) {
        return JavaUtils.isTrue(dotNetSoapEncFix);
      }
    }
  }
  return TypeMappingImpl.dotnet_soapenc_bugfix;
}

代码示例来源:origin: axis/axis

/**
 * isDotNetSoapEncFixNeeded - Do we need to compensate for the dotnet bug.
 * check the service specific flag before using the global flag
 * @return
 */
private boolean isDotNetSoapEncFixNeeded() {
  MessageContext msgContext = MessageContext.getCurrentContext();
  if (msgContext != null) {
    SOAPService service = msgContext.getService();
    if (service != null) {
      String dotNetSoapEncFix = (String) service.getOption(AxisEngine.PROP_DOTNET_SOAPENC_FIX);
      if (dotNetSoapEncFix != null) {
        return JavaUtils.isTrue(dotNetSoapEncFix);
      }
    }
  }
  return TypeMappingImpl.dotnet_soapenc_bugfix;
}

代码示例来源:origin: org.apache.axis/com.springsource.org.apache.axis

/**
 * isDotNetSoapEncFixNeeded - Do we need to compensate for the dotnet bug.
 * check the service specific flag before using the global flag
 * @return
 */
private boolean isDotNetSoapEncFixNeeded() {
  MessageContext msgContext = MessageContext.getCurrentContext();
  if (msgContext != null) {
    SOAPService service = msgContext.getService();
    if (service != null) {
      String dotNetSoapEncFix = (String) service.getOption(AxisEngine.PROP_DOTNET_SOAPENC_FIX);
      if (dotNetSoapEncFix != null) {
        return JavaUtils.isTrue(dotNetSoapEncFix);
      }
    }
  }
  return TypeMappingImpl.dotnet_soapenc_bugfix;
}

代码示例来源:origin: axis/axis

/**
   * Returns the endpoint URL that should be used in the returned WSDL.
   *
   * @param msgContext the current Axis JAX-RPC message context
   * @return the endpoint URL that should be used in the returned WSDL
   * @throws AxisFault if we fail to obtain the {@link org.apache.axis.description.ServiceDesc} for this service
   */
  protected String getEndpointURL(MessageContext msgContext)
      throws AxisFault {
    // First see if a location URL is explicitly set in the MC.
    String locationUrl = msgContext.getStrProp(
        MessageContext.WSDLGEN_SERV_LOC_URL);
    if (locationUrl == null) {
      // If nothing, try what's explicitly set in the ServiceDesc.
      locationUrl =
          msgContext.getService().getInitializedServiceDesc(
              msgContext)
          .getEndpointURL();
    }
    if (locationUrl == null) {
      // If nothing, use the actual transport URL.
      locationUrl = msgContext.getStrProp(MessageContext.TRANS_URL);
    }
    return locationUrl;
  }
}

代码示例来源:origin: net.sourceforge.addressing/addressing

/**
 * {@inheritDoc}
 */
@Override
protected void setTargetService(SOAPMessageContext soapMsgContext,
 AddressingHeaders headers) throws Exception {
 org.apache.axis.MessageContext axisMsgContext
  = (org.apache.axis.MessageContext) soapMsgContext;
 // TODO: why is the below code necessary? - add comments
 if (axisMsgContext.getService() == null
   && axisMsgContext.getTargetService() == null) {
  axisMsgContext.setTargetService(getTargetServiceName(headers));
  // This is to ensure the SOAPEnvelope is rebuilt with the right type mappings and
  // MessageContext is set with the right properties.
  if (axisMsgContext.getTargetService() != null) {
   ((Message) axisMsgContext.getMessage()).getSOAPPartAsString();
  }
 }
}

代码示例来源:origin: org.apache.openejb/openejb-axis

public void createResult(final Object object) {
  messageContext.setPastPivot(true);
  try {
    final Message requestMessage = messageContext.getRequestMessage();
    final SOAPEnvelope requestEnvelope = requestMessage.getSOAPEnvelope();
    final RPCElement requestBody = getBody(requestEnvelope, messageContext);
    final Message responseMessage = messageContext.getResponseMessage();
    final SOAPEnvelope responseEnvelope = responseMessage.getSOAPEnvelope();
    final ServiceDesc serviceDescription = messageContext.getService().getServiceDescription();
    final RPCElement responseBody = createResponseBody(requestBody, messageContext, operation, serviceDescription, object, responseEnvelope, getInOutParams());
    responseEnvelope.removeBody();
    responseEnvelope.addBodyElement(responseBody);
  } catch (final Exception e) {
    throw new ServerRuntimeException("Failed while creating response message body", e);
  }
}

相关文章

微信公众号

最新文章

更多

MessageContext类方法