Problem About Salesforce SOAP API 32.0 In .Net Project

最近在集成项目项目中遇到一个问题:在用最新版本(API 32.0)Enterprise WSDL在.Net 中做集成时,初始化SforceService 时会初始化类错误。这算是Salesforce 在新版本SOAP API 中的一个BUG ,在以前版本没有这个问题,需要大家注意下。

具体错误信息如下:

message: Sync Error,System.TypeInitializationException: The type initializer for ‘SyncUtility.SForce.DataUility‘ threw an exception. ---> System.TypeInitializationException: The type initializer for ‘SyncUtility.SForce.ServiceProvider‘ threw an exception. ---> System.InvalidOperationException: Unable to generate a temporary class (result=1). 
error
CS0030: Cannot convert type
‘SyncUtility.SForce.EnterpriseService.ListViewRecordColumn[]‘ to
‘SyncUtility.SForce.EnterpriseService.ListViewRecordColumn‘ 
error
CS0030: Cannot convert type
‘SyncUtility.SForce.EnterpriseService.ListViewRecordColumn[]‘ to
‘SyncUtility.SForce.EnterpriseService.ListViewRecordColumn‘ 
error
CS0029: Cannot implicitly convert type
‘SyncUtility.SForce.EnterpriseService.ListViewRecordColumn‘ to
‘SyncUtility.SForce.EnterpriseService.ListViewRecordColumn[]‘ 
error
CS0029: Cannot implicitly convert type
‘SyncUtility.SForce.EnterpriseService.ListViewRecordColumn‘ to
‘SyncUtility.SForce.EnterpriseService.ListViewRecordColumn[]‘ 
 
产生问题的原因

是Salesforce新版本的WSDL触发了Microsoft 的关于WSDL 的一个限制。

解决方法如下:

方法一:

在生成Proxy Class 后,替换所有的ListViewRecordColumn[][] 为ListViewRecordColumn[];

方法二:

在WSDL 中进行修改,保存后再生成Proxy Class .具体修改操作如下:

<complexType name="ListViewRecordColumn">
                <sequence>
                    <element name="fieldNameOrPath"          type="xsd:string"/>
                    <element name="value"                    type="xsd:string" nillable="true"/>
                </sequence>
            </complexType>

修改为:

<complexType name="ListViewRecordColumn">
                <sequence>
                    <element name="fieldNameOrPath"          type="xsd:string"/>
                    <element name="value"                    type="xsd:string" nillable="true"/>
                </sequence>
            </complexType>

PS:

在生成WSDL 时,如遇到如下截图所示,这个不是Salesforce 的问题,是Firefox 浏览器显示的问题,大家不要惊慌,也不要纠结。鼠标右键另存为Enterprise.WSDL,文件类型为所有文件,保存后就得到你所需的wsdl .

Refrence:

Microsoft 关于WSDL 的限制:

https://connect.microsoft.com/VisualStudio/feedback/details/471297

Salesforce Community  关于此问题描述:

https://developer.salesforce.com/forums/ForumsMain?id=906F0000000AiPEIA0

时间: 2024-12-18 22:52:09

Problem About Salesforce SOAP API 32.0 In .Net Project的相关文章

使用customer.update 方法 ,magento 1.7.0.2 soap api bug

使用 magento(1.7.0.2) 的soap api 更新用户信息的时候发现不能够更新用户的密码. 我们首先看一下 如何调用api 更新用户信息(参考自:magentocommerce) <?php $api_url_v1 = "http://192.168.1.162/trunk/index.php/api/soap/?wsdl"; $username = 'moshi'; $password = 'moshiPass'; //连接 SOAP $client = new

springsecurity启动出现org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: You must use a 3.0 schema with Spring Security 3.0.

在换了spring-security的jar包以后启动出现org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: You must use a 3.0 schema with Spring Security 3.0.Please update your schema declarations to the 3.0.3 schema (spring-securi

[Baidu Map]百度地图 JAVASCRIPT API V2.0 大众版 工具类

关键代码: /* *@description 百度地图 JAVASCRIPT API V2.0 大众版 工具类 *@author YanZhiwei *@see http://developer.baidu.com/map/reference/index.php *@email [email protected] */ (function () { map = {}; infoWindow = {}; BmapUtils = { CONSTANT: { DYNAMIC_CITY: "上海&quo

EWS API 2.0读取日历信息-读取内容注意事项

[from] http://www.cnblogs.com/love007/archive/2013/06/26/3156852.html 采用模拟账号的方式读取日历信息,注意下日历的内容读取(Body)读取.代码如下:(采用 EWS API 2.0版本) 1.读取内容前必须设置如下属性:否则会提示:You must load or assign this property before you can read its value  Body 如下: //*******************

How ASP.NET Web API 2.0 Works?[持续更新中…]

一.概述 RESTful Web API [Web标准篇]RESTful Web API [设计篇] 在一个空ASP.NET Web项目上创建一个ASP.NET Web API 2.0应用 二.路由 ASP.NET的路由系统:URL与物理文件的分离 ASP.NET的路由系统:路由映射 ASP.NET的路由系统:根据路由规则生成URL ASP.NET Web API路由系统的几个核心类型 Web Host下的URL路由 三.消息处理管道 ASP.NET Web API标准的"管道式"设计

Android BLE与终端通信(五)——Google API BLE4.0低功耗蓝牙文档解读之案例初探

Android BLE与终端通信(五)--Google API BLE4.0低功耗蓝牙文档解读之案例初探 算下来很久没有写BLE的博文了,上家的技术都快忘记了,所以赶紧读了一遍Google的API顺便写下这篇博客心得 Google API:http://developer.android.com/guide/topics/connectivity/bluetooth-le.html#terms 其实大家要学习Android的技术,Google的API就是最详细的指导书了,而且通俗易懂,就算看不懂

软考 -&gt; 子网172.6.32.0/20被划分成子网172.6.32.0/26

为了复习一下计算机知识,响应公司号召参加软考,看书过程中发现好多知识都忘却了... 比如,下面这道题目,我是真不会啊. 如果子网172.6.32.0/20被划分成子网172.6.32.0/26,则下面的结论中正确的是() A. 被划分成62个子网 B. 每个子网有64个主机地址 C. 被划分成32个子网 D. 每个子网有62个主机地址 172.6.32.0/20中的20表示网络号的位数. 172.6.32.0 = (10101100,00000110,00100000,00000000)2 而1

JSON API 1.0 核心开发者自述 | 你所不知道的那些技术细节

2013年5月,Yehuda Katz 完成了JSON API(英文,中文) 技术规范的初稿.事情就发生在 RailsConf 之后,在那次会议上他和 Steve Klabnik 就 JSON 雏形的技术细节相聊甚欢.在沟通单一 Rails 服务器库-- ActiveModel::Serializers 和单一 JavaScript 客户端库-- Ember Data 的强烈呼声下,JSON API 应运而生(关于这段历史,我在2013年2月第一届 EmberCamp 上有一个演讲,感兴趣的可以

Web Api 2.0中使用Swagger生成Api文档的2个小Tips

当Web Api 2.0使用OAuth2授权时,如何在Swagger中添加Authorization请求头? Swagger说明文档支持手动调用Api, 但是当Api使用OAuth2授权时,由于没有地方可以输入授权Token, 导致响应结果一直是401没有授权. 解决方案: 在Swagger配置文件中,添加对请求头中Authorization的设置. 1. 在Api项目中添加一个新类AddAuthorizationHeader并实现IOperationFilter接口 public class