Immowelt API Dokumentation
Immowelt API Dokumentation
Immowelt API Dokumentation
Sie wollen auch ein ePaper? Erhöhen Sie die Reichweite Ihrer Titel.
YUMPU macht aus Druck-PDFs automatisch weboptimierte ePaper, die Google liebt.
4.16. Beispiel in C# zur Nutzung des EstateService<br />
EstateService estateService = new EstateService ();<br />
LocationService ls = new LocationService ();<br />
void Search( string areaDescription )<br />
{<br />
LocationResponse lr = ls.GetLocation (areaDescription);<br />
}<br />
if (lr.Status == LocationResponseStatus.OK)<br />
{<br />
GetItems( -1, lr.Location[0].GeoID);<br />
}<br />
private int GetItems( int ambit, string geoID)<br />
{<br />
int pageSize = 5;<br />
int currentPage = 1;<br />
//define the search parameters.<br />
EstateParameter[] estateParams = new EstateParameter[3];<br />
estateParams[0] = new EstateParameter();<br />
estateParams[0].Key = EstateParameterKey.EType;<br />
estateParams[0].Value = "1";<br />
estateParams[1] = new EstateParameter();<br />
estateParams[1].Key = EstateParameterKey. RooMi;<br />
estateParams[1].Value = "1";<br />
estateParams[2] = new EstateParameter();<br />
estateParams[2].Key = EstateParameterKey. RooMa;<br />
estateParams[2].Value = "4";<br />
//call GetListAmbit with ambit = -1 for an equal call<br />
//to GetList ... or define the ambit and get a smaller<br />
//result-set.<br />
EstateServiceListResponse eslr = estateService.GetListAmbit(<br />
geoID, estateParams, currentPage,<br />
pageSize, ambit);<br />
if( eslr.Status == EstateServiceListResponseStatus.ResultTooLarge )<br />
{<br />
//GetList/GetListAmbit returns ResultTooLarge,<br />
//you have to define even more estateParams and/or use<br />
//GetListAmbit with param ambit > -1.<br />
//You can call GetRegionOverview to test if you are<br />
//searching for a city with districts or a region with<br />
//administrative district.<br />
//The EstateServiceRegionOverviewResponse.Items are<br />
//showing a list of possible districts.<br />
ShowDistricts( geoID, estateParams);<br />
DisplayResultTooLargeMessage();<br />
© <strong>Immowelt</strong> AG Seite 39 von 56