Select to view content in your preferred language

Rest Services given error after upgrading ArcGIS Server from 10.9.1 to 11.3

176
3
12-02-2024 03:06 AM
AfrozAlam
Occasional Contributor

I have  an application named Al Murshid on App Store, developed using Xcode 16.4 & Swift 5.4 and ArcGIS SDK for iOS 100.x.  

It was running fine but now the GIS Services have been migrated from ArcGIS Server 10.9.1 to 11.3 . The application started giving problems. The details of the error is attached in pdf format. The service's URL is the part of PDF file. 

I would be very grateful if some expert have give solution of the problem.

Thanks & regards,

Afroz Alam

Afroz Alam
0 Kudos
3 Replies
NimeshJarecha
Esri Regular Contributor

Hi @AfrozAlam,

Sorry to hear that you are running into the issues. I looked at the attached pdf and have few questions,

1. Are you building the query or is it build by some of the SDK functionality? Some sample code would help.

2. If I remove the quotes from the query value then it works (ZONE_NO = '54' -> ZONE_NO = 54). I'll have to go back and check whether quotes were expected for 10.9.1. 

https://services.gisqatar.org.qa/server/rest/services/Vector/ZonesE/MapServer/0/query?where=ZONE_NO+...

3. Did you just upgrade the server from 10.9.1 to 11.3 or recreated services after installing 11.3?

 

Regards,

Nimesh 

0 Kudos
AfrozAlam
Occasional Contributor

Dear Nimesh,

Thank you very much for your reply.  I am answering your question one by one

1.  I am building a query in Swift and the code as follows

 private func queryZone(_ zn: String) {

        let queryParams = AGSQueryParameters()

        queryParams.whereClause = "ZONE_NO = \(zn)"

//        queryParams.whereClause = "ZONE_NO = '\(zn)'

        self.ZoneFeatureTable?.populateFromService(with: queryParams, clearCache: true, outFields: ["*"]) { [weak self] (queryResult: AGSFeatureQueryResult?, error: Error?) in

            guard let self = self else { return }

            if let error = error {

                self.presentAlert(error: error)

            } else if let features = queryResult?.featureEnumerator().allObjects {

                if !features.isEmpty {

                    self.searchedFeatures = features

                    let feature = self.searchedFeatures.first

                    self.selectedFeature = feature

                    let att = feature?.attributes.value(forKey: "ZONE_NO")

                    self.area = feature?.attributes.value(forKey: "SHAPE.AREA") as? Double

                    self.perimeter = feature?.attributes.value(forKey: "SHAPE.LEN") as? Double

                    print("Attr: \(String(describing: att))")

                    print("Area: \(String(describing: self.area))")

                    print("Perimeter: \(String(describing: self.perimeter))")

                } else {

                    self.presentAlert(message: self.languageBundle.localizedString(forKey:"NO_RECORD_FOUND", value:"", table: nil))

                }

                

            }

            

            self.execute_Segue()

            self.spinner.stopAnimating()

        }

        

    }

2. This solution is working but earlier with 10.9.1, it was working with single quote i.e. ZONE_NO = '54'.

3. We have just upgraded the server from, 10.9.1 to 11.3 and recreated the services.

Hope to get a solution that is not required to remove the single quote ('') because it has been used at many places.

Thanks & regards,

Afroz

 

Afroz Alam
0 Kudos
NimeshJarecha
Esri Regular Contributor

Hi @AfrozAlam,

Thank you for responding to my questions and providing the code.

Based on the function private func queryZone(_ zn: String), you are passing the zone value as string. If the field type is esriFieldTypeString in the service then you have to provide the single quote. You can check this string query for GFCODE = 'PDGVZONE' vs the ZONE_NO = 54. The query for the field type esriFieldTypeSmallInteger does not require single quote.

By any chance the 10.9.1 service was published with ZONE_NO as esriFieldTypeString but 11.3 service with ZONE_NO as esriFieldTypeSmallInteger?

Regards,

Nimesh

0 Kudos