Rating:
4
Joined: Feb 26, 2015
Company: Uguz Limited sirketi
Hello to everyone. I can read operation with the HTTP service. I want to read from the external data source. But I can not. Error code : {HTTPService.Test.Module(19)} : An error occurred in the process of content method call ( Execute )
What am I doing wrong?
Code
Function TestTest(Request)
Response = New HTTPServiceResponse(200);
Result = "";
Query = New Query;
Query.Text =
"SELECT
| dbo_TBL_KULLANICI.KULLANICI,
| dbo_TBL_KULLANICI.KULLANICI AS KULLANICI1,
| dbo_TBL_KULLANICI.KULLANICI AS KULLANICI2,
| dbo_TBL_KULLANICI.KULLANICI AS KULLANICI3,
| dbo_TBL_KULLANICI.KULLANICI AS KULLANICI4,
| dbo_TBL_KULLANICI.KULLANICI AS KULLANICI5,
| dbo_TBL_KULLANICI.KULLANICI AS KULLANICI6
|FROM
| ExternalDataSource.demo_mtsk.Table.dbo_TBL_KULLANICI AS dbo_TBL_KULLANICI";
QueryResult = Query.Execute();
SelectionDetailRecords = QueryResult.Select();
JSONWriter = New JSONWriter;
JSONWriterSettings = New JSONWriterSettings(, Chars.Tab);
JSONWriter.SetString(JSONWriterSettings);
dizi = New Array;
While SelectionDetailRecords.Next() Do
yapi = New Structure;
yapi.Insert("Tarih",SelectionDetailRecords[0]);
yapi.Insert("Unvan",SelectionDetailRecords[1]);
yapi.Insert("GorusmeTipi",SelectionDetailRecords[2]);
yapi.Insert("GorusmeNedeni",SelectionDetailRecords[3]);
yapi.Insert("GorusmeDurumu",SelectionDetailRecords[4]);
yapi.Insert("GorusmeDetayi",SelectionDetailRecords[5]);
yapi.Insert("GorusmeSonucu",SelectionDetailRecords[6]);
dizi.Add(yapi);
EndDo;
WriteJSON(JSONWriter, dizi);
Result = JSONWriter.Close();
Response = New HTTPServiceResponse(?(True, 200, 404));
Response.SetBodyFromString(Result, TextEncoding.System);
Return Response;
EndFunction
Firstly check connection to external database. Open "Main menu" - "All functions" - "External data sources" and sel ect required table. Do you receive errors? Can you see data fr om external database?
Rating:
4
Joined: Feb 26, 2015
Company: Uguz Limited sirketi
I have 2 different servers. The first server installed 1C. Microsoft SQL Server Standard License. The second server in SQL Server Express Edition installed. They tried my users can connect to the server 1C. (Web and Remote Access / 1C Ports Open) Both servers also open access.
Rating:
4
Joined: Feb 26, 2015
Company: Uguz Limited sirketi
When trying to open a table; - I have to write the connection string again. - I have to write the database username and password. - I have to give approval. - After the table opens.