Advertisement
Guest User

Untitled

a guest
Jan 29th, 2020
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.34 KB | None | 0 0
  1. var client = GetClient();
  2. var session = await client.CreateSessionIDAsync();
  3. var sessionID = session.@return.SessionID;
  4. var pl = 73;
  5. var katowice = 28191;
  6. var katowickiPark = 412;
  7. var asciiSearch = false;
  8. var positionPoint = new TSoapTLongLatPoint()
  9. {
  10.     Latitude = 21,
  11.     Longitude = 52
  12. };
  13.  
  14. var pointPositions = new TSoapTLocalizeObjectPositionData[1]
  15. {
  16.                 new TSoapTLocalizeObjectPositionData()
  17.                 {
  18.                     PositionPoint = positionPoint
  19.                 }
  20. };
  21.  
  22. var stringFields = new string[1][];
  23. stringFields[0] = new string[1] { "The only string" };
  24.  
  25. var doubleFields = new double[1][];
  26. doubleFields[0] = new double[1] { 1.1 };
  27.  
  28. await client.SearchInitializeAsync(sessionID, asciiSearch);
  29. var citiesResponse = await client.SearchSelectCitiesAsync(sessionID, pl, "", "", "", "", "");
  30.  
  31. var itemsResponse = await client.SearchSelectItemsAsync(sessionID, katowice, 0, "");
  32. var objectsResponse = await client.SearchGetItemsListAsync(sessionID, katowickiPark, 2);
  33.  
  34. var localizeResponse = await client.LocalizeAddObjectPositionsAsync(
  35.     sessionID, 1, pointPositions, stringFields, doubleFields);
  36. // returns -203 not matter if EntityID = 0 (index in ObjectsResponse) or 421 (index in a static list) still returns -203
  37.  
  38. Console.WriteLine($"Server response code: {localizeResponse.@return.ToString()}");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement