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

忘记是在哪个项目上碰到的,反正是碰到了,就是标准对象的地址类型在引用入.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>

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

posted @ 2015-07-28 09:26  dog2k_sf  阅读(317)  评论(0)    收藏  举报