Notes: This is thanks to Andreass, Judson and Billy ^^
Objective: The finality of this is to show a way to interact with a Web Service created in By Design Studio and how to consume this web service with an external client. This will be with an object that gets two numbers, then adds them together, and multiply together.
Steps:
PROCEDURE
1. Create the BO, this has two elements. In Solution Explorer right clic > Agregate > New element > Business Object with name "AddMult"
Code for BO AddMult:
import AP.Common.GDT as apCommonGDT;
businessobject AddMult {
[AlternativeKey]element OperationID: ID;
element Value1 : IntegerValue;
element Value2 :IntegerValue;
element Result1 :IntegerValue;
element Result2 :IntegerValue;
}
After creation, you must to activate the BO.
2.Create script, for this, right click to the BO and Create ScriptFiles and select "Event-AfterModify.absl"
Use this code:
import ABSL;
this.Result1 = this.Value1 + this.Value2;
this.Result2 = this.Value1 * this.Value2;
Activate the script (right click and Activate)
3. Create the screens for this BO, right click to the BO and select Create Screens > Floorplan with Navigation > OK.
This will create the screens and the work center that we will need.
4. You can modify the screens, in this case QA Screen (Quick Activity), OWL Screen (Object Work List), the elements are in disorder.
a. For QA select "SectionGroup" and in Properties Tab > Contents > Collection, with the arrows you can give the adecuate order, then OK.
b.For OWL select "List" in Properties Tab > Child Elements > ListColumns, then if asks if you want to replace the name, select No, then with the arrows you can modify the order, then OK.
c. Save the screens and Activate.
d. Assign the authorizations for this user in ByDesign.
1. You need to enter in your corresponding tenant
2. In "Application and User Management" Work Center search for the user will have the authorizations.
3. Select the new work center and its view.
e. Then you can do operations in the new Work Center "AddMult"
1. You need to write the OperationID, Value1, Value2 and Save, the script will activate and write the corresponding resuts
2. You can see the results in ByDesign
5. Create the Web Service from the BO created. Right click to the BO > Create Web Service
a. Give a name for this web service
b. Select the elements would be involved in this web service (in this case, all of them)
c. For the option "Create", only mark the OperationID, Value1, Value2.
d. For the option "Read", mark all of them, so you can see all the fields.
e. Query and Action not necessary for this example.
f. Create a new authorized view you will use to add it a to a Work Center, give it a name. (Maybe you can use an existing view)
g. Then you can select the operations for this view.
h. The field "External UI Application" is empty in wsauth.
i. Open the Work Center in UI Designer (is that called WCF).
j. In Configuration Explorer you use the created view for this web service, add it to the view.
(use Test View, there would be two)
k. Now you can see the view has the name of the Web Service View (maybe you need close and re-open the WCF).
l. If there is no view where to assign, you can add it in Properties of Work Center > View Switches (Selecting AddMult Folder).
m. Activate Web Service in Solution Explorer.
n. Again in By Design you need to assign the view for this User (4.d from this Tutorial).
o. Download WSDL (Right click to the created web service and Download WSDL)
6. Use the download WSDL to tests.
a. Open SOAP UI
b. New soapUI Project
c. Browse the downloaded WSDL
d. Now with XML you can do the corresponding calls.
Use Authentication Type: Preemptive.
Try with the user and password you assigned in By Design
e. You can do the calls
Read (need to use a valid ID, this case, only created operations)
Create(use all the fields, OperationID, Value1, Value2)
f. You can see the change in ByDesign
That's all, any doubts, tell me 😃
Angel.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
8 | |
5 | |
5 | |
4 | |
4 | |
4 | |
4 | |
4 | |
3 | |
3 |