• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java SoapConnection类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.sforce.soap.apex.SoapConnection的典型用法代码示例。如果您正苦于以下问题:Java SoapConnection类的具体用法?Java SoapConnection怎么用?Java SoapConnection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SoapConnection类属于com.sforce.soap.apex包,在下文中一共展示了SoapConnection类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: execute

import com.sforce.soap.apex.SoapConnection; //导入依赖的package包/类
@Override
public void execute() throws BuildException {
	
	checkCronExpression();
	checkScheduleName();
	
	try {
		SoapConnection tc = ConnectionFactory.getToolingConnection(getConfig());
		String apexCode = String.format(SCHEDULE_APEX, className, className, scheduleName, cron);
		executeApex(tc, apexCode);
		log(String.format("%s has been scheduled",scheduleName));
	} catch (ConnectionException e) {
		handleException(e);
	}
	
}
 
开发者ID:eroispaziali,项目名称:ForceFlow,代码行数:17,代码来源:ScheduleJobTask.java


示例2: getToolingConnection

import com.sforce.soap.apex.SoapConnection; //导入依赖的package包/类
public static SoapConnection getToolingConnection(PartnerConnection pc, SalesforceConfig config) throws ConnectionException {
	LoginResult lr = pc.login(config.getUsername(), config.getPassword());
	ConnectorConfig toolingConfig = new ConnectorConfig();
	toolingConfig.setSessionId(pc.getSessionHeader().getSessionId());
	toolingConfig.setServiceEndpoint(lr.getServerUrl().replace("Soap/u/", "Soap/s/"));
	toolingConfig.setManualLogin(false);
	SoapConnection soapConnection = Connector.newConnection(toolingConfig);
	return soapConnection;
}
 
开发者ID:eroispaziali,项目名称:ForceFlow,代码行数:10,代码来源:ConnectionFactory.java


示例3: executeApex

import com.sforce.soap.apex.SoapConnection; //导入依赖的package包/类
protected void executeApex(SoapConnection tc, String apexCode) throws BuildException {
	try {
		ExecuteAnonymousResult result = tc.executeAnonymous(apexCode); 
		if (!result.isSuccess()) {
			String error = result.isCompiled() ? result.getExceptionMessage() : result.getCompileProblem();
			throw new BuildException(error);
		}
	} catch (ConnectionException e) {
		handleException(e);
	}
}
 
开发者ID:eroispaziali,项目名称:ForceFlow,代码行数:12,代码来源:SalesforceTask.java


示例4: executeAnonymous

import com.sforce.soap.apex.SoapConnection; //导入依赖的package包/类
public ExecuteAnonymousResultExt executeAnonymous(String code, LogInfo[] logInfo, Connection connection,
        int readTimeout) {
    ConnectorConfig connectorConfig = connection.getConnectorConfig();
    
    boolean orig_traceMsg = connectorConfig.isTraceMessage();
    boolean orig_prettyPrintXml = connectorConfig.isPrettyPrintXml();
    String orig_sessionId = connectorConfig.getSessionId();
    String orig_serviceEndpoint = connectorConfig.getServiceEndpoint();
    int orig_readTimeout = connectorConfig.getReadTimeout();
    
    connectorConfig.setTraceMessage(true);
    connectorConfig.setPrettyPrintXml(true);
    connectorConfig.setSessionId(connection.getSessionId());
    connectorConfig.setServiceEndpoint(connection.getApexServiceEndpoint(connection.getServiceEndpoint()));
    connectorConfig.setReadTimeout(readTimeout);
    
    SoapConnection apex = null;
    try {
        apex = Connector.newConnection(connectorConfig);
        apex.setDebuggingHeader(logInfo, LogType.None);
        return new ExecuteAnonymousResultExt(apex.executeAnonymous(code), apex.getDebuggingInfo());
    } catch (ConnectionException e) {
        ExecuteAnonymousResult er = errorExecuteAnonymousResult(connectorConfig, e);
        ExecuteAnonymousResultExt erx = new ExecuteAnonymousResultExt(er, null == apex ? null : apex.getDebuggingInfo());
        DebuggingInfo_element dbi = new DebuggingInfo_element();
        dbi.setDebugLog(e.getMessage());
        erx.setDebugInfo(dbi);
        return erx;
    } finally {
        connectorConfig.setTraceMessage(orig_traceMsg);
        connectorConfig.setPrettyPrintXml(orig_prettyPrintXml);
        connectorConfig.setSessionId(orig_sessionId);
        connectorConfig.setServiceEndpoint(orig_serviceEndpoint);
        connectorConfig.setReadTimeout(orig_readTimeout);
    }
}
 
开发者ID:forcedotcom,项目名称:idecore,代码行数:37,代码来源:ApexService.java


示例5: execute

import com.sforce.soap.apex.SoapConnection; //导入依赖的package包/类
public void execute() {
  	try {
  		if (fileName != null && ! fileName.isEmpty()) {
    	code = new Scanner(new File(fileName)).useDelimiter("\\A").next();
	}

  		SoapConnection connection = getApexConnection();

          LogInfo infoApex = new LogInfo();
          infoApex.setCategory(LogCategory.Apex_code);
          infoApex.setLevel(LogCategoryLevel.Finest);

          LogInfo infoDB = new LogInfo();
          infoDB.setCategory(LogCategory.Db);
          infoDB.setLevel(LogCategoryLevel.Finest);

          connection.setDebuggingHeader(new LogInfo[] { infoApex, infoDB }, LogType.Detail);

          ExecuteAnonymousResult result = connection.executeAnonymous(code);
          if (result.isSuccess()) {
              log(connection.getDebuggingInfo().getDebugLog());
              log("Success");
          } else {
              throw new BuildException(result.getExceptionMessage());
          }
      } catch (ConnectionException e) {
          log("Note: use ant -verbose to get more information on the failure");
          throw new BuildException("Failed: " + e.getMessage(), e);
} catch (IOException ioe) {
	log(ioe.getMessage());
}
  }
 
开发者ID:wojdyga,项目名称:ExecuteAnonymous,代码行数:33,代码来源:AnonymousExecuter.java


示例6: setCallOptions

import com.sforce.soap.apex.SoapConnection; //导入依赖的package包/类
public void setCallOptions(SoapConnection apexConnection, String clientId) throws ForceConnectionException {
    apexConnection.setCallOptions(clientId, null, null);
}
 
开发者ID:forcedotcom,项目名称:idecore,代码行数:4,代码来源:Connection.java



注:本文中的com.sforce.soap.apex.SoapConnection类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java PublisherModel类代码示例发布时间:2022-05-22
下一篇:
Java ByteValue类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap