Iron Speed Technical Forums
Register Latest Topics
 
 
 


Reply
  Author   Comment  
ikrami2000

Registered:
Posts: 215
Reply with quote  #1 
Anyone can help on Restfull :

1- I create application just Resfull , and i select table for Add, Edit and show records
2- When i deployed it , return two folder Provider and Consumer

Now:

what is the URL to Add record ?
what is the URL to Edit record ?
what is the URL to get records if i pass for example ID record ?

For Example when i connect with other application i used POSTMAN application

so i have to give :

GET : http://URL/api/datasources/allocations

Content-Type: application/json
accept: application/json

How to do that for my application in local




JimiJ

Avatar / Picture

MVP Developer
Registered:
Posts: 1,947
Reply with quote  #2 
Have you explored this?: http://www.ironspeed.com/videos/AnkitVijayvargiya/V120.RESTful-API-Application-Generation.aspx#gsc.tab=0
__________________

  Jaime Jegonia
[jts_logo]

Iron Speed MVP Developer
 

". . . and whoever sows generously will also reap generously" 2 Cor 9:6

ikrami2000

Registered:
Posts: 215
Reply with quote  #3 
ISP is easy to create Restfull Application, my question is how to call it usually i am using 
httprequest but what about the URL or Data to send for example the below is sample for what i did before for other application :


string postData = "{\"Authentication\": {\"Username\": "+loc_username+",\"Password\": "+loc_password+",}}";


string Url = "http://app1.cloud.appspace.com/api/v1/token/request";
HttpWebRequest myHttpWebRequest = (HttpWebRequest)HttpWebRequest.Create(Url);
myHttpWebRequest.Method = "POST";

byte[] data = Encoding.ASCII.GetBytes(postData);


myHttpWebRequest.ContentType = "application/json";
myHttpWebRequest.Accept = "application/json";
myHttpWebRequest.ContentLength = data.Length;

Stream requestStream = myHttpWebRequest.GetRequestStream();
requestStream.Write(data, 0, data.Length);
requestStream.Close();

HttpWebResponse myHttpWebResponse = (HttpWebResponse)myHttpWebRequest.GetResponse();

Stream responseStream = myHttpWebResponse.GetResponseStream();

StreamReader myStreamReader = new StreamReader(responseStream, Encoding.Default);

vReturnValue = myStreamReader.ReadToEnd();


myStreamReader.Close();
responseStream.Close();

myHttpWebResponse.Close();

villar

Avatar / Picture

Registered:
Posts: 19
Reply with quote  #4 

At http://www.ironspeed.com/products/Sample-Applications.aspx#gsc.tab=0 there is a link in the Order Management System: http://www.ironspeed.com/Designer/12.2.0/Restful_OMS.rar, with a sample application that includes a custom client (RestFulAPICustom). There and in the help (http://www.ironspeed.com/Designer/12.2.0/WebHelp/desktop/Part_VIII/Third_Party_Application.htm) you can see that the API is different from the one you expect.
For example, for list of records you use:

http: // <apiserver> / <apiapp> / Controllers / CommonRestful / PostGetRecordListForTable on and send as  POST with table information in body

{

PageSize: 3,

PageIndex: 0,

TotalRows: 0,

TableName: 'Categories',

JSelectColumns: [{ColumnName: 'CategoryID'}, {ColumnName: 'CategoryName'}],

JJoinsList: null,

JOrderByList: [{ColumnName: 'CategoryName', OrderDirection: 'ASC'}],

JGroupByList: null,

JWhereClause: null

}

The response comes like this

[1] \ r \ n \ r \ n \ r \ n \ r \ n \ r \ n \ r \ n \ r \ n \ N], \ r \ n 3 \ r \ n \ "Confections \" \ r \ n]

This is not  json. You will have convert this information to your client object.

Also you must convert the base classes code used  to  your client environment (Angular 2 component?). Hard work!

Em http://www.ironspeed.com/products/Sample-Applications.aspx#gsc.tab=0 existe um link em Order Management System: http://www.ironspeed.com/Designer/12.2.0/Restful_OMS.rar de download de uma aplicação exemplo que inclui um cliente custom (RestFulAPICustom). Nele e no help (http://www.ironspeed.com/Designer/12.2.0/WebHelp/desktop/Part_VIII/Third_Party_Application.htm) você pode ver que a API é diferente da que você espera.

 

Por exemplo, para lista de registros você usa:

 

http://<apiserver>/<apiapp>/Controllers/CommonRestful/PostGetRecordListForTable em envia POST como

 

{

PageSize: 3,

PageIndex: 0,

TotalRows: 0,

TableName: 'Categories',

JSelectColumns: [{ColumnName: 'CategoryID'}, {ColumnName: 'CategoryName'}],

JJoinsList: null,

JOrderByList:[{ColumnName: 'CategoryName', OrderDirection: 'ASC'}],

JGroupByList: null,

JWhereClause: null

}

 

A response vem assim

 

[\r\n [\r\n 1,\r\n \"Beverages\"\r\n ],\r\n [\r\n 2,\r\n \"Condiments\"\r\n ],\r\n [\r\n 3,\r\n \"Confections\"\r\n ]\r\n]

 

Veja que não é json. Você terá que transformá-la!

 

 


 

At http://www.ironspeed.com/products/Sample-Applications.aspx#gsc.tab=0there is a link in the Order Management System: http://www.ironspeed.com/Designer/12.2.0/Restful_OMS.rar, with a sample application that includes a custom client (RestFulAPICustom). There and in the help (http://www.ironspeed.com/Designer/12.2.0/WebHelp/desktop/Part_VIII/Third_Party_Application.htm) you can see that the API is different from the one you expect.

For example, for list of records you use:

Http: // <apiserver> / <apiapp> / Controllers / CommonRestful / PostGetRecordListForTable on and send as  POST with table information in body

{

PageSize: 3,

PageIndex: 0,

TotalRows: 0,

TableName: 'Categories',

JSelectColumns: [{ColumnName: 'CategoryID'}, {ColumnName: 'CategoryName'}],

JJoinsList: null,

JOrderByList: [{ColumnName: 'CategoryName', OrderDirection: 'ASC'}],

JGroupByList: null,

JWhereClause: null

}

The response comes like this

[1] \ r \ n \ r \ n \ r \ n \ r \ n \ r \ n \ r \ n \ r \ n \ N], \ r \ n 3 \ r \ n \ "Confections \" \ r \ n]

This is not  json. You will have convert this information to your client object.

Also you must convert the base classes code used for your client environment . Hard work!

 

 

 

 

 


__________________
Fernando Villar
Casa Villar Software
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Download Iron Speed Designer

Terms of Service Privacy Statement