Salesforce WSDL引用到.Net发生无法解析地址字段的错误解决

本文讨论了在.NET环境中遇到的SOQL标准对象地址类型引用错误的问题,并提供了在WSDL中增加特定配置的解决方案来解决此问题。

忘记是在哪个项目上碰到的,反正是碰到了,就是标准对象的地址类型在引用入.Net后报错,说找不到对应的类型。

所以,需要在WSDL下增加以下的语句(好像是在WSDL里增加吧,忘记了,汗一把。。。。)

Add the following within the <xsd:schema elementFormDefault="qualified" targetNamespace="http://soap.sforce.com/schemas/class/<classname>"> element:

<!-- Compound datatype: Address -->
<xsd:complexType name="address">
<xsd:complexContent>
<xsd:extension base="tns:location">
<xsd:sequence>
<xsd:element name="city" type="xsd:string" nillable="true"/>
<xsd:element name="country" type="xsd:string" nillable="true"/>
<xsd:element name="countryCode" type="xsd:string" nillable="true"/>
<xsd:element name="postalCode" type="xsd:string" nillable="true"/>
<xsd:element name="state" type="xsd:string" nillable="true"/>
<xsd:element name="stateCode" type="xsd:string" nillable="true"/>
<xsd:element name="street" type="xsd:string" nillable="true"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>

<!-- Compound datatype: Location -->
<xsd:complexType name="location">
<xsd:sequence>
<xsd:element name="latitude" type="xsd:double" nillable="true"/>
<xsd:element name="longitude" type="xsd:double" nillable="true"/>
</xsd:sequence>
</xsd:complexType>

---恢复内容结束---

转载于:https://www.cnblogs.com/dog2k/p/4681862.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值