kwdavids
16 years ago
Delphi 2007. I invoke the web service without error. I can see in
trace data that the web service returns the data I want. The problem
is that when I try to look at specific data items, through the
interface they are blank. I can't post everything (the interface unit
is like 70,000 lines). I've tried various WSDL import options with no
success.
Here's the message returned to my SOAP client:
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns="urn:enterprise.soap.sforce.com" xmlns:xsi="http://www.w3.org/
2001/XMLSchema-instance"
xmlns:sf="urn:sobject.enterprise.soap.sforce.com"><soapenv:Body><queryResponse><result><done>true</
done><queryLocator xsi:nil="true"/><records
xsi:type="sf:Contact"><sf:FirstName>Warner</
sf:FirstName><sf:LastName>Time</sf:LastName></records><records
xsi:type="sf:Contact"><sf:FirstName>Tom</
sf:FirstName><sf:LastName>Rush</sf:LastName></records><size>2</size></
result></queryResponse></soapenv:Body></soapenv:Envelope>
I can see the value for Size, but Contact.FirstName and
Contact.LastName are "".
Here's the Delphi code snip:
var
fqo: enterprise.queryOptions;
fqr: enterprise.queryResult;
fQueryResponse: enterprise.queryResponse;
con: enterprise.Contact;
soj: enterprise.sObject;
fQuery: enterprise.Query;
i: Integer;
begin
fqo := enterprise.QueryOptions.Create; // Don't try to free it
with fqo do begin
BatchSize := 200;
end;
SendSoapHeader(fqo);
SendSessionID;
try
fQuery := query.Create;
fQuery.queryString := eQuery.Text;
fQueryResponse := ifv.query(fQuery);
fqr := fQueryResponse.result;
mTrace.Lines.Add('Query didn''t blow up, Size=' + IntToStr
(fqr.size));
if fqr.Done then
mTrace.Lines.Add('These are all the records');
for i := 0 to fqr.size - 1 do begin
soj := fqr.records[i];
con := enterprise.Contact(soj);
mTrace.Lines.Add('First Name: ' + con.FirstName
+ ' Last Name: ' + con.LastName);
end;
Snips from the interface:
Contact = class(sObject)
...
published
property FirstName: WideString Index
(IS_OPTN or IS_NLBL) read FFirstName write SetFirstName stored
FirstName_Specified;
...
describeSObject = class(TRemotable)
private
FsObjectType: WideString;
published
property sObjectType: WideString read FsObjectType write
FsObjectType;
end;
...
QueryResult = class(TRemotable)
private
Fdone: Boolean;
FqueryLocator: QueryLocator;
Frecords: Array_Of_sObject;
Frecords_Specified: boolean;
Fsize: Integer;
procedure Setrecords(Index: Integer; const AArray_Of_sObject:
Array_Of_sObject);
function records_Specified(Index: Integer): boolean;
public
destructor Destroy; override;
published
property done: Boolean read Fdone write Fdone;
property queryLocator: QueryLocator Index (IS_NLBL) read
FqueryLocator write FqueryLocator;
property records: Array_Of_sObject Index (IS_OPTN or IS_UNBD
or IS_NLBL) read Frecords write Setrecords stored records_Specified;
property size: Integer read Fsize write Fsize;
end;
...
Array_Of_sObject = array of sObject;
trace data that the web service returns the data I want. The problem
is that when I try to look at specific data items, through the
interface they are blank. I can't post everything (the interface unit
is like 70,000 lines). I've tried various WSDL import options with no
success.
Here's the message returned to my SOAP client:
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns="urn:enterprise.soap.sforce.com" xmlns:xsi="http://www.w3.org/
2001/XMLSchema-instance"
xmlns:sf="urn:sobject.enterprise.soap.sforce.com"><soapenv:Body><queryResponse><result><done>true</
done><queryLocator xsi:nil="true"/><records
xsi:type="sf:Contact"><sf:FirstName>Warner</
sf:FirstName><sf:LastName>Time</sf:LastName></records><records
xsi:type="sf:Contact"><sf:FirstName>Tom</
sf:FirstName><sf:LastName>Rush</sf:LastName></records><size>2</size></
result></queryResponse></soapenv:Body></soapenv:Envelope>
I can see the value for Size, but Contact.FirstName and
Contact.LastName are "".
Here's the Delphi code snip:
var
fqo: enterprise.queryOptions;
fqr: enterprise.queryResult;
fQueryResponse: enterprise.queryResponse;
con: enterprise.Contact;
soj: enterprise.sObject;
fQuery: enterprise.Query;
i: Integer;
begin
fqo := enterprise.QueryOptions.Create; // Don't try to free it
with fqo do begin
BatchSize := 200;
end;
SendSoapHeader(fqo);
SendSessionID;
try
fQuery := query.Create;
fQuery.queryString := eQuery.Text;
fQueryResponse := ifv.query(fQuery);
fqr := fQueryResponse.result;
mTrace.Lines.Add('Query didn''t blow up, Size=' + IntToStr
(fqr.size));
if fqr.Done then
mTrace.Lines.Add('These are all the records');
for i := 0 to fqr.size - 1 do begin
soj := fqr.records[i];
con := enterprise.Contact(soj);
mTrace.Lines.Add('First Name: ' + con.FirstName
+ ' Last Name: ' + con.LastName);
end;
Snips from the interface:
Contact = class(sObject)
...
published
property FirstName: WideString Index
(IS_OPTN or IS_NLBL) read FFirstName write SetFirstName stored
FirstName_Specified;
...
describeSObject = class(TRemotable)
private
FsObjectType: WideString;
published
property sObjectType: WideString read FsObjectType write
FsObjectType;
end;
...
QueryResult = class(TRemotable)
private
Fdone: Boolean;
FqueryLocator: QueryLocator;
Frecords: Array_Of_sObject;
Frecords_Specified: boolean;
Fsize: Integer;
procedure Setrecords(Index: Integer; const AArray_Of_sObject:
Array_Of_sObject);
function records_Specified(Index: Integer): boolean;
public
destructor Destroy; override;
published
property done: Boolean read Fdone write Fdone;
property queryLocator: QueryLocator Index (IS_NLBL) read
FqueryLocator write FqueryLocator;
property records: Array_Of_sObject Index (IS_OPTN or IS_UNBD
or IS_NLBL) read Frecords write Setrecords stored records_Specified;
property size: Integer read Fsize write Fsize;
end;
...
Array_Of_sObject = array of sObject;