我正在尝试在 C#(ASP.Net MVC)中检索必填字段信息,但它抛出异常:'UNKNOWN_EXCEPTION:目标 URL 未重置。从登录返回的 URL 必须在执行 'object[] results = ...' 代码行时在 SforceService' 中设置。任何帮助将不胜感激。
protected SforceService binding;
//usr.UserGuid.ToString()='a65596bd-e8d3-11e2-80fc-902b34ee1bea';
var counquery = binding.queryAll("SELECT AccountId, IsDeleted FROM Contact WHERE WDA_Record_ID__c = '" + usr.UserGuid.ToString() + "'");
//Method: queryall
/// <remarks/>
[System.Web.Services.Protocols.SoapHeaderAttribute("LimitInfoHeaderValue", Direction=System.Web.Services.Protocols.SoapHeaderDirection.Out)]
[System.Web.Services.Protocols.SoapHeaderAttribute("QueryOptionsValue")]
[System.Web.Services.Protocols.SoapHeaderAttribute("SessionHeaderValue")]
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace="urn:enterprise.soap.sforce.com", ResponseNamespace="urn:enterprise.soap.sforce.com", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
[return: System.Xml.Serialization.XmlElementAttribute("result")]
public QueryResult queryAll(string queryString) {
object[] results = this.Invoke("queryAll", new object[] {
queryString});
return ((QueryResult)(results[0]));
}