org.apache.axis.client.Call.getMessageContext()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(4.8k)|赞(0)|评价(0)|浏览(197)

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

Call.getMessageContext介绍

[英]Obtain a reference to our MessageContext. Note: Not part of JAX-RPC specification.
[中]获取对MessageContext的引用。注意:不是JAX-RPC规范的一部分。

代码示例

代码示例来源:origin: stackoverflow.com

private String getSOAPResponseXML(Object clientstub) {
  String returnValue = null;
  org.apache.axis.client.Stub stub = (org.apache.axis.client.Stub)clientstub;
  Call call = stub._getCall();
  if (call != null) {
    MessageContext ctx = call.getMessageContext();
    // If I registered a handler
    // returnValue = (String) ctx.getProperty( ClientHandler.SOAP_RESPONSE );

    // or use:
    try {
      Message msg = call.getResponseMessage();
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      // NOTE: If we never get a response (a request handler throws an uncaught error
      // this can cause a java.lang.NullPointerException
      msg.writeTo(baos);
      returnValue = baos.toString();
    } catch (java.io.IOException ex) {
      log.debug("Error in getSOAPResponseXML", ex);
    } catch (javax.xml.soap.SOAPException ex) {
      log.debug("Error in getSOAPResponseXML", ex);
    }
  }
  return returnValue;
} // getSOAPResponseXML

代码示例来源:origin: net.sf.taverna.t2.activities/wsdl-activity

protected void configureSecurity(Call call,
    WSDLActivityConfigurationBean bean) throws Exception {
  // If security settings require WS-Security - configure the axis call
  // with appropriate properties
  URI securityProfile = bean.getSecurityProfile();
  if (securityProfile
      .equals(SecurityProfiles.WSSECURITY_USERNAMETOKEN_PLAINTEXTPASSWORD)
      || securityProfile
          .equals(SecurityProfiles.WSSECURITY_USERNAMETOKEN_DIGESTPASSWORD)
      || securityProfile
          .equals(SecurityProfiles.WSSECURITY_TIMESTAMP_USERNAMETOKEN_PLAINTEXTPASSWORD)
      || securityProfile
          .equals(SecurityProfiles.WSSECURITY_TIMESTAMP_USERNAMETOKEN_DIGESTPASSWORD)) {
    UsernamePassword usernamePassword = getUsernameAndPasswordForService(bean, false);
    call.setProperty(Call.USERNAME_PROPERTY, usernamePassword.getUsername());
    call.setProperty(Call.PASSWORD_PROPERTY, usernamePassword.getPasswordAsString());
    usernamePassword.resetPassword();
  } else if (securityProfile.equals(SecurityProfiles.HTTP_BASIC_AUTHN)){
    // Basic HTTP AuthN - set HTTP headers
    // pathrecursion allowed
    UsernamePassword usernamePassword = getUsernameAndPasswordForService(bean, true);
    MessageContext context = call.getMessageContext();
    context.setUsername(usernamePassword.getUsername());
    context.setPassword(usernamePassword.getPasswordAsString());
    usernamePassword.resetPassword();
  } else {
    logger.error("Unknown security profile " + securityProfile);
  }
}

代码示例来源:origin: org.n52.metadata/smarteditor-api

/**
 * @param pFacade
 */
protected void initFacade(IFacade pFacade) {
  if (pFacade instanceof ExtendedFacade) {
    try {
      // get envelope
      SOAPEnvelope lEnvelope = mCall.getMessageContext().getResponseMessage().getSOAPEnvelope();
      // instantite tc record provider
      TcRecordProvider lRecordProvider = new TcRecordProvider();
      // extract records
      lRecordProvider.extractTcRecord(lEnvelope);
      // update facade
      ((ExtendedFacade) pFacade).setTcRecords(lRecordProvider.getTcRecord());
      // instantite fedcatinfo provider
      FederatedCatalogInfoProvider lInfoProvider = new FederatedCatalogInfoProvider();
      // extract fedcatinfo
      lInfoProvider.extractFedCatInfo(lEnvelope);
      // update facade
      ((ExtendedFacade) pFacade).setFedCatInfo(lInfoProvider.getFederatedCatalogIDs());
    } catch (AxisFault axisFault) {
      LOG.error("Error setting up the facade security information.");
      LOG.error("Reason: {}", axisFault.getFaultReason());
      LOG.error("Fault string: {}", axisFault.getFaultString());
    } catch (SOAPException e) {
      LOG.error("Error setting up the facade security information.");
      LOG.error("Reason: {}", e.getMessage());
    }
  }
}

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

((org.apache.axis.Message)request).setMessageContext(call.getMessageContext());
Attachments attachments = ((org.apache.axis.Message)
    request).getAttachmentsImpl();

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

((org.apache.axis.Message)request).setMessageContext(call.getMessageContext());
Attachments attachments = ((org.apache.axis.Message)
    request).getAttachmentsImpl();

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

((org.apache.axis.Message)request).setMessageContext(call.getMessageContext());
Attachments attachments = ((org.apache.axis.Message)
    request).getAttachmentsImpl();

代码示例来源:origin: googleads/googleads-java-lib

builder.withException(e);
} finally {
 MessageContext messageContext = stub._getCall().getMessageContext();
 RequestInfo.Builder requestInfoBuilder = new RequestInfo.Builder()
     .withMethodName(stub._getCall().getOperationName().getLocalPart())

代码示例来源:origin: com.google.api-ads/ads-lib-axis

builder.withException(e);
} finally {
 MessageContext messageContext = stub._getCall().getMessageContext();
 RequestInfo.Builder requestInfoBuilder = new RequestInfo.Builder()
     .withMethodName(stub._getCall().getOperationName().getLocalPart())

相关文章