• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
MSCRM janmson
MS CRM顾问及二次开发
博客园    首页    新随笔    联系   管理    订阅  订阅

soap help method

Code
// Helper method to execute a SOAP request
function executeSoapRequest(action, xml)
{
  
var actionUrl = "http://schemas.microsoft.com/crm/2007/WebServices/";
  actionUrl 
+= action;
  
  
var xmlHttpRequest = new ActiveXObject("Msxml2.XMLHTTP");
  xmlHttpRequest.Open(
"POST", "/mscrmservices/2007/CrmService.asmx", false);
  xmlHttpRequest.setRequestHeader(
"SOAPAction",actionUrl);
  xmlHttpRequest.setRequestHeader(
"Content-Type", "text/xml; charset=utf-8");
  xmlHttpRequest.setRequestHeader(
"Content-Length", xml.length);
  xmlHttpRequest.send(xml);

  
var resultXml = xmlHttpRequest.responseXML;
  
return resultXml;
}

// Helper method to return a single node value from XML
function getNodeValue(tree, el)
{
  
var retVal = null;
  
var e = null;
  e 
= tree.getElementsByTagName(el);

  
if (e != null && e[0] != null) {
    retVal 
= e[0].firstChild.nodeValue;
  }
  
return retVal;
}

// Helper method to return a multiple node value from XML
function getMultipleNodeValues(tree, el)
{
  
var retVal = new Array();
  
var e = null;
  e 
= tree.getElementsByTagName(el);

  
for(i = 0; i < e.length; i++) {
    retVal[i] 
= e[i].firstChild.nodeValue;
  }

  
return retVal;
}
posted @ 2009-05-06 21:50  韩建兴  阅读(131)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3