Error parsing xml

Your demostration code for Objective-C generates an error.. Could not parse loaded json with error:Error Domain=NSCocoaErrorDomain Code=3840 "JSON text did not start with array or object and option to allow fragments not set." UserInfo={NSDebugDescription=JSON text did not start with array or object and option to allow fragments not set.

Comments

  •  
    There is a problem with the call from the MSSQL server. The result of the call is not recognized. My code is as follows. DECLARE @url URL=N'http://flightlookup.azure-api.net/v1/xml/TimeTable/ICN/GUM/20221001/' DECLARE @param NVARCHAR(500)='7Day=Y&Connection=DIRECT&Sort=Departure' DECLARE @status int DECLARE @responseTable as table(responseText NVARCHAR(MAX)) DECLARE @responseText NVARCHAR(MAX) DECLARE @rsText varchar(MAX) DECLARE @res as Int; DECLARE @hResult int EXEC sp_OACreate 'WinHttp.WinHttpRequest.5.1', @res OUT; EXEC sp_OAMethod @res, 'open', NULL, 'GET',@url,'false'; EXEC sp_OAMethod @res, 'setRequestHeader', NULL, 'Ocp-Apim-Subscription-Key','590e91e415134052b1607db9cb213831'; EXEC sp_OAMethod @res, 'setRequestHeader', null, 'Content-Type', 'text/xml;charset=UTF-8' EXEC sp_OAMethod @res, 'setRequestHeader', null, 'Accept-Encoding', 'gzip,deflate' EXEC sp_OAMethod @res, 'setRequestHeader', null, 'Connection', 'Keep-Alive' EXEC sp_OAMethod @res, 'send' EXEC sp_OAMethod @res, 'getResponseHeader', null, 'Content-Encoding' -- Return null EXEC sp_OAMethod @res, 'GetAllResponseHeaders' -- Response doesn't incluye 'Content-Encoding: gzip', Soap UI does!. INSERT INTO @responseTable (ResponseText) EXEC sp_OAGetProperty @res, 'responseText'; EXEC sp_OAGetProperty @res, 'status', @status OUT; EXEC sp_OADestroy @res; SELECT ResponseText FROM @responseTable SELECT @status
    Posted by Hidden Thu, 15 Sep 2022 04:06:26 GMT


You're not signed in. Please sign-in to report an issue or post a comment.